I have a program that gets some parameters at runtime. I don't know how to set this parameters when I am running this program by Eclipse.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
I have a program that gets some parameters at runtime. I don't know how to set this parameters when I am running this program by Eclipse.
By parameter, do you mean command line parameters? These can be set by going to Run->Run Configurations and click on the Arguments tab
I want to run the following command by eclipse.
but I don't know how I should write it in Arguments tab in run configuration.java -cp ".;test.jar" Demo models\program.tagger input.txt
Right Click on the java file containing public static void main method.
Go to properties - run\debug settings - select class and click edit button on right side.
In arguments tab, provide the runtime arguments, that will go into String args[ ].
In classpath tab, provide jars and folders that you want to specify using -cp parameter in comand line.
Hope this helps