• 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
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Running JAR file problem...

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
You are HERE! The other map is obviously wrong. Better confirm with this tiny ad:
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!