Tim
Tim

Reputation: 1074

Java - Eclipse IDE

When running a program via Eclipse is it possible to provide command like arguments to be stored in the String[] args as you can on the command line?

Upvotes: 3

Views: 141

Answers (6)

Ketan Bhavsar
Ketan Bhavsar

Reputation: 5396

In Run configuuration you can give it here at this location.

enter image description here

Upvotes: 1

Martin
Martin

Reputation: 7139

Yes. The easiest way is to right-click on the class you want to run and select

Run As->Run Configurations

There is a tab to add arguments.

Upvotes: 2

JB Nizet
JB Nizet

Reputation: 691625

Yes. Click on Run - Run configurations... Then select your run configuration, select the Arguments tab, and enter arguments in the Arguments text area.

Upvotes: 3

Thomas Owens
Thomas Owens

Reputation: 116161

Yes.

If you click on the arrow next to the "Run" button, you can open the Run Configurations menu. You can specify both Program Arguments (which are passed into the args[] parameter to your main method) as well as VM Arguments.

Upvotes: 4

talnicolas
talnicolas

Reputation: 14053

Just specify those arguments in the Run configuration (Arguments tab) menu of your project.

Upvotes: 4

Johm Don
Johm Don

Reputation: 629

Yes. You can specify it as part of the run configuration for a project

Upvotes: 3

Related Questions