Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAR not working

 
Jason Stortz
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a bunch of .class files in the current directory, as well as a single line text file which has the following:
Main-Class: MyServer
Then, I move into that directory and use the following command:
jar mcf main-class.txt MyServer.jar *.class repository/*.class
This gives me a MyServer.jar file which is great. Then, I want to use:
java -jar MyServer.jar
to execute the application. Well, this doesn't seem to work. When I go back and unpack the jar with jar xvf MyServer.jar and look at the manifest file it doesn't have anything about the Main-class stuff in it!
Can anyone offer any advice?
Thanks
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've had a similar problem, but using class path in the manifest. Fixed it by using -M and including the META-INF directory.
It seems a lot easier just to zip up what you need, naming it .jar.
[This message has been edited by Michael Hildner (edited April 24, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic