NetBeans IDE - how to run Java application with console

27,663

Solution 1

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.

Solution 2

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.

Solution 3

You can go to Run Configurations... and set your VM Settings there. It should be passed on to the console when it runs.

Share:
27,663
user592704
Author by

user592704

Updated on December 06, 2020

Comments

  • user592704
    user592704 over 3 years

    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