NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

How to add Maven System Properties to 'Run File' Command line

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
tomzi



Joined: 19 Aug 2008
Posts: 4

PostPosted: Thu Aug 25, 2011 8:15 am    Post subject: How to add Maven System Properties to 'Run File' Command line Reply with quote

Normally with running a java Main Class I add System properties like this:
java -Darg1=Hi -Darg2=5 MyClass

However in NB I have no clue how to do that
.) I created a 'Run' Configuration
.) I added my system properties to the 'Run file via main()' under Actions like:

exec.args=-classpath %classpath ${packageClassName} -Darg1=Hi

but my little test program:

public class App
{
public static void main( String[] args )
{
System.out.println( "arg1=" + System.getProperty("arg1"));
}
}

would show 'arg1=null'

Any idea?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo