• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

NetBeans passing entry parameter for main

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the menu navigational path to get to 'project properties"?

Thank you.
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Marshal
Posts: 80267
430
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this thread would sit better on our IDEs forum. Moving.
 
Bud Tippins
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
First, you drop a couch from the plane, THEN you surf it. Here, take this tiny ad with you:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic