File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Command line argument question.

 
Roger Fed
Ranch Hand
Posts: 82
Java Oracle
  • 0
  • 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
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic