Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to pass parameters to a jar from eclipse

 
ujjawal rohra
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I need to run the command

java -DcreateSolution=true -jar abc.jar from the eclipse IDE.
How and where would I pass the parameter -DcreateSolution=true from eclipse. It will also work if I pass this parameter to my project but I can not do this also.
I can do this in cmd.

 
Tom Reilly
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the menu item Run | Run Configurations. Select the Arguments tab.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18276
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tom Reilly wrote:From the menu item Run | Run Configurations. Select the Arguments tab.


Note that the "-D" option is a VM option, not a command option, so make sure you enter the "-D" parameter in the VM arguments textarea and not the command arguments textarea!
 
ujjawal rohra
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it worked...

Thanks Tim and Tom
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic