• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help with running executable JAR

 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...class files are packed in a JAR using
%jar -cvmf manifest.txt genApp GenApp.class

I can see icon for JAR, but when i double click, nothing happens. even using ...open with..., JAR still doesn't open!
someone please help this beginner...!!!
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's in manifest.mf? For this to work, it would need to contain a line
like

Main-Class: GenApp

GenApp also needs to have a method named

public static void main(String[] argv)

You could type

java -jar genapp.jar

at the command line and you would get a (possibly informative) error message if it didn't work.
 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
manifest.txt has
Main-class: GenApp

when I run
java -jar genApp.jar
i get "NoClassDefFound" error. but when i run java GenApp, the program runs fine?
 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i've figured it out. the problem was that when i ran the jar tool, i wrote
%jar -cvmf manifest.text genApp GenApp.class, instead of using *.class, so only one class was found, and not the other nested classes
[ July 23, 2005: Message edited by: kwame Iwegbue ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic