• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

help with running executable JAR

 
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...!!!
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • 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
Boost this thread!