File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes NetBeans: Passing parameters to main( ) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "NetBeans: Passing parameters to main( )" Watch "NetBeans: Passing parameters to main( )" New topic

NetBeans: Passing parameters to main( )

Arthur Blair
Ranch Hand

Joined: Sep 20, 2005
Posts: 71
I am using NetBeans version 4.1 and I want to pass some parameters to the main() method of one of my classes. My problem is that when I right click on the class in the folder tree, it runs so fast that I don't have time to enter the parameters.

I understand that you can set parameters beforehand by rightclicking on the project the selecting Properties >> Run >> Arguements. But this only works when the class is set as the Main class for the entire project. However, when you run the entire project NetBeans tries to compile everything, and won't run if some classes won't compile. I don't want to test everything yet, just a specific class.

Is there a another way to enter parameters into main using NetBeans?
[ November 25, 2005: Message edited by: Arthur Blair ]
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15100

Netscape?? Do you mean NetBeans?

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Arthur Blair
Ranch Hand

Joined: Sep 20, 2005
Posts: 71
I agree. Here's the link:
subject: NetBeans: Passing parameters to main( )
It's not a secret anymore!