Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse settings problem

 
Rahul Jadaun
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello people,

What do I have to do to make eclipse prompt for command line parameters.

Regards,
Rahul.
 
bart zagers
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you can make Eclipse prompt for command line parameters.
You can specify them in the "Run..." (or "Debug...") dialogue in the "(x) arguments" tab.
[ February 15, 2007: Message edited by: bart zagers ]
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, in my version of eclipse, that tab contains a "Variables..." button. If you click it, you can choose from a huge number of variables, including a number of "..._prompt" variables, which will do exactly what you want.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34401
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ilja Preuss:
Actually, in my version of eclipse

And which version is that?
 
bart zagers
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ilja Preuss:
Actually, in my version of eclipse, that tab contains a "Variables..." button. If you click it, you can choose from a huge number of variables, including a number of "..._prompt" variables, which will do exactly what you want.


Thanks, you are right. I've never noticed/used it before. This might come in handy at times.
(Eclipse 3.2.1, but I installed (a test version of) MyEclipseIDE just this week).
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if this is kosher, but in this situation where I need easy access to the command line args, I just run my java prog from another helper prog. For instance if I have a main prog called MainProg, I rename the main method to "myMain" and call it from a second Java prog:



and I have a helper class called RunMain (or whatever) that has something like this:



and I have a helper class called RunMain (or whatever) that has something like this:



This way I can change my command line args at will.
String[] commandLineArgs = {"Pete", "Stein", "is", "great!"};
MainProg.myMain(commandLineArgs);
}
}
[/CODE]

This way I can change my command line args at will in the code.
[ March 15, 2007: Message edited by: pete stein ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic