This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Command line argument question.

 
Roger Fed
Ranch Hand
Posts: 82
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
I have developed a class using NetBeans and i want to run it using command line , I've configured command line and it work correctly but my question is:
where this class should be stored to run it using command line arguments?
thanks........
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15484
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anywhere you like. A class doesn't have to be stored in a special place or special way to be able to run it using command line arguments.

You can run it from a Windows command prompt with the java command, something like this:

C:\Project> java -classpath classes org.mypackage.MyProgram arg0 arg1 arg2 ...

where classes is the directory that contains the class files and org.mypackage.MyProgram is the fully-qualified name of the class that contains the main method, and arg0, arg1 etc. are the command line arguments.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic