• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I run a jar from a dos commandline  RSS feed

 
Tony Evans
Ranch Hand
Posts: 598
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this java helper program in a jar, the problem is that I have no idea how to run it from the command line. I would be very grtaeful for any help.

Thanks Tony
 
Biswajit Paria
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

run as:

java -jar <jar file name>

here Jar file should contain a java class that has public static void main(String args[]) signature

Regards,

Biswajit.
************************************
The only joy in the world is to begin !
 
Tony Evans
Ranch Hand
Posts: 598
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks it works

Tony
 
Paul Santa Maria
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, once you've installed Java on your PC, you don't even need the "java -jar" command. Just type the jarfile name (or double-click on it in Windows explorer) and Windows will automatically execute it for you.

PS:
To make this work, your jar will need a "META-INF/MANIFEST.MF" with a "Main-Class:" clause.
[ September 12, 2006: Message edited by: Paul Santa Maria ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!