File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes JAR - error message... need help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JAR - error message... need help!" Watch "JAR - error message... need help!" New topic

JAR - error message... need help!

Gaurav Malhotra

Joined: Jan 02, 2005
Posts: 2
Hello i have been trying to create a JAR file so i can run the code straight away without any dos commands.


1) I created a text file with the following code:

Main-class: gaurav

.... and saved it as mainClass (no extension)

2) In MS DOS i typed the following command:

jar cmf mainClass emain.jar *

I created the jar file but now i recieve the following error:

Failed to load main-class manifest attribute from
c:\documents and settings\*\javafiles\new\emain.jar

What could be the problem?
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
Did you end the mainClass text file with a blank line?
[ January 02, 2005: Message edited by: Mike Gershman ]

Mike Gershman
SCJP 1.4, SCWCD in process
Gaurav Malhotra

Joined: Jan 02, 2005
Posts: 2
Yes i did.

Thanks for your reply.
It is sorta covered in the JavaRanch Style Guide.
subject: JAR - error message... need help!