This week's book giveaway is in the Agile forum.
We're giving away four copies of Head First Agile and have Andrew Stellman & Jennifer Greene on-line!
See this thread for details.
Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

command line read/write  RSS feed

 
pete reisinger
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
first I'll explain what I want to do:
I have a jar file, that takes options and file name as an argument. I've just created GUI, so user doesn't have to type options and file name on command line, but can use GUI.
My question is, how should I use that jar file? Do I open command line, send arguments and file name from GUI and then read the output? If so, then could you tell me which class to use?
Or is there a better way?
Thanks a lot.
 
Rob Spoor
Sheriff
Posts: 21095
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you know the name of the main class you can call its main method:
After all, the main method is little more than a public static method. The only difference is that it is the method the JVM will invoke when calling java / javaw.
 
pete reisinger
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
of course, sorry for the stupid question, looks like I need a small break,
thanks for the quick answer
 
Rob Spoor
Sheriff
Posts: 21095
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!