wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes help with running executable JAR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "help with running executable JAR" Watch "help with running executable JAR" New topic
Author

help with running executable JAR

kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
...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...!!!


Who dares, wins! (SAS motto)
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

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.


[Jess in Action][AskingGoodQuestions]
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
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

Joined: Sep 02, 2000
Posts: 197
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 ]
 
wood burning stoves
 
subject: help with running executable JAR
 
Similar Threads
Jarsigner tool
How to view jar files
how to open the jar file
StringTokenizer with hasNext method as condition
Can not find driver?