wood burning stoves 2.0*
The moose likes Java in General and the fly likes Running JAR file problem... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Running JAR file problem..." Watch "Running JAR file problem..." New topic
Author

Running JAR file problem...

Sathish Babu
Greenhorn

Joined: Jul 01, 2000
Posts: 3
hi all,
i've created a jar file like :
jar cmf mainClass NewKeyword.jar com Classes
where, mainClass is my manifest file which has
Main-Class: GUIKW001
com,Classes are packages used by the main-class.
This works fine and my jar file is created but the problem im
facing is that when i run the jar file like :
jar -jar NewKeyword.jar
it is showing FAILED TO LOAD MAIN-CLASS MANIFEST ATTRIBUTE FROM NEWKEYWORD.JAR...and im using jdk1.2.2
whats the error?...pl,help me out...
thanx in advance,
sathish
Neeraj Kohli
Greenhorn

Joined: Jul 18, 2000
Posts: 2
Hi Satish,
To run the jar file, you need to give the following comand on command prompt
java- jar NewKeyword.jar
Apart from this, after having a manifest file for main class, as U have already given, U must be able to run the application by double-clicking on it( jar file) in the windows-explorer. Or else give me your code and I will run it for U
Cheers :-)
NK

Originally posted by Sathish Babu:
hi all,
i've created a jar file like :
jar cmf mainClass NewKeyword.jar com Classes
where, mainClass is my manifest file which has
Main-Class: GUIKW001
com,Classes are packages used by the main-class.
This works fine and my jar file is created but the problem im
facing is that when i run the jar file like :
jar -jar NewKeyword.jar
it is showing FAILED TO LOAD MAIN-CLASS MANIFEST ATTRIBUTE FROM NEWKEYWORD.JAR...and im using jdk1.2.2
whats the error?...pl,help me out...
thanx in advance,
sathish

Sathish Babu
Greenhorn

Joined: Jul 01, 2000
Posts: 3
Hey Nk,
Im sorry to say that i made a mistake in my posting...
its the same which u've mentioned...
java -jar KeywordSearch.jar
and im happy to say that i found the prob by myself...
the prob was with the manifest file in which i didn't give a
carriage return...now its working fine...thanx for responding
my god! i've wasted nearly 2 hrs for where i made the mistake...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running JAR file problem...