How to pass a file as a command line argument in Netbeans

I have been trying to work with Netbeans for the last two days. I am writing a scanner program that takes scanner input from the token_list.java file. So, how can we provide this token_list.java file as an argument to the main file (Scanner.java). When I do this on a Unix system using the command line argument, everything works fine and well. The problem occurs when I do this on netbeans. I even tried to provide the token_list.java file name as an argument in the startup properties in the project. But then I realized that the command line arguments for the run properties are for input only, not for the file name.

Update: the command I give on unix is ​​$ java. Scanner input.text So now I am trying to make netbeans right-click on scanner.java and run it. But then he gives the error that no arguments were passed. I take the file name in argv

+5
source share
2 answers

There is a built-in community plugin called NbRunWithArgs https://github.com/tusharvjoshi/nbrunwithargs that will provide you with a Run with Arguments option when starting a Java project or a single Java file.

You can use this plugin, more information is available in the blog post here.

UPDATE (24 2014 .) NetBeans, , "" , , , NetBeans IDE 8.0

Run with Arguments plugin as shown in NetBeans IDE 8.0 plugins dialog box

+5

Netbeans "" "" , , , !

+3

All Articles