• 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
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

jar file

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I can't seem to run the jar file which i have created using 'jar cf myjar.jar *.class.
I exec the command 'java -jar myjar.jar'. But it just doesn't work. Can any1 help?
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
There are two ways to do that.
1)You need specify the class name which contains the main
method.
java -jar myjar.jar mainclass
2)Use a manifest file when you jar you java files.
jar cvfm myjar.jar manifest.mf *.class
Hope this helps.
qionghua
 
reply
    Bookmark Topic Watch Topic
  • New Topic