tags:

views:

47

answers:

3

I develop the JAVA in Eclipse.

If I want to add argument my java program I must appoint a value by setting of the practice environment .

So I try it

java myproram arg1 arg2 ..

Can I this method in Eclipse?

+2  A: 

Yes, you can. You need to configure the commandline arguments in the Run Dialog. You can get there by dropping down the Run menu and selecting the 'Open Run Dialog...' menu item. Once there, you can select your program task from the tree on the left pane. You will then see a set of tabs on the right. The second tab allows you to input your args.

akf
+4  A: 

Yep, firstly if you select your code you can choose to "Run as a Java Application". This will cause your application to run with no parameters, but it'll be exactly like 'java myprogram'.

Then, if you want to actually add arguments... you can create run configurations. Right click on a file, select Run As > Run Configurations. From there, you can create a new configuration for a Java Application and set the commandline arguments and VM arguments (if you need any).

Malaxeur
+4  A: 
Pascal Thivent
Best answer due to picture, IMO.
MetroidFan2002