File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes NetBeans passing entry parameter for main Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "NetBeans passing entry parameter for main" Watch "NetBeans passing entry parameter for main" New topic
Author

NetBeans passing entry parameter for main

Bud Tippins
Ranch Hand

Joined: Jan 28, 2011
Posts: 52
I'm trying to run a program from NetBeans that takes a parameter for main when the program first starts. How can I pass that parameter to NetBeans? I'm using "run" but do not see any way to pass it a parameter.

Any help greatly appreciated.

Thank you.

Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4489
    
    8

Look in the project properties. There should be a place to set arguments for the java command (and compiler arguments as well, if you ever need them).
Bud Tippins
Ranch Hand

Joined: Jan 28, 2011
Posts: 52
What is the menu navigational path to get to 'project properties"?

Thank you.
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4489
    
    8

I'm using Netbeans 6.9.1, and I can get to them by right-clicking on the project in the projects window and choosing "Properties" from the pop-up menu. Then look under the "Run" category.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40027
    
  28
I think this thread would sit better on our IDEs forum. Moving.
Bud Tippins
Ranch Hand

Joined: Jan 28, 2011
Posts: 52
Now I found it. Thank you. I populated it with a value and then ran and got the following error:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at practicestuff.PracticeStuff.main(PracticeStuff.java:7)
Java Result: 1

It seems like the jvm is not receiveing the parameter? Any help greatly appreciated.

Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NetBeans passing entry parameter for main