Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NetBeans IDE - how to run Java application with console

I am just wondering is there a way in NetBeans to start Java application with console arguments (I mean the default ones input for main method)? I mean the effect like when you run your app with Command Prompt manually:

>MyTestApp arg0 arg1 argN

I couldn't find the IDE feature so I need your advice. Is there a way to run apps with NetBeans in that way?

P.S. NetBeans 6.5.1

like image 929
user592704 Avatar asked Dec 21 '22 12:12

user592704


2 Answers

Right click on your project's name and select "Properties" from the menu. One of the tabs in that window lets you set command-line arguments. I don't recall the exact one off the top of my head.

like image 172
Code-Apprentice Avatar answered Jan 16 '23 00:01

Code-Apprentice


After you build the project Netbeans will show you the build results in the output pane. simply copy the last line that indicates the location of the main jar file executable, for example:

java -jar /home/abusada/NetBeansProjects/userInput/dist/userInput.jar

start your terminal on Linux or console on Windows and paste the above.

Hit enter to run your file.

like image 36
Ashraf Sada Avatar answered Jan 16 '23 01:01

Ashraf Sada