File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Main-Class manifest attribute

 
Chad McMullin
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every time I try to load any jarfile I get this error message.
Failed to load Main-Class manifest attribute for jarfile
how do i fix this
OS: Windows ME
Java Version: j2re 1.4.2
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chad,

Welcome to JavaRanch!

Not all JAR files are meant to be launched as applications; some are just libraries. If you try to launch a library JAR as an application, you'll see an error like this.

If you tell us specifically what you're trying to launch, perhaps we could give you some advice.
 
Chad McMullin
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The file is Java.iras.071204.jar available at:
Noaa
The installation instructions are at:
java -jar java.iras.071204 [xvf]Installation instructions
I'm trying to install it use the run command line:
java -jar c:\java.iras.071204.jar [xvf]
But keep getting the same error message. In the instuction it says to use the -classpath command. But I don't know the path I need to set or how to include it in the commmand line.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right, OK. So it's not an executable jar, and the "java -jar" option won't work.

Here's what you do from your command prompt:

- cd \
- mkdir IRAS.
- cd C:\IRAS.
- Use "DIR" to confirm that it's an empty directory.
- Download or copy the file Java.IRAS.071204.jar into C:\IRAS.
- Use "DIR" to confirm that the file is now in C:\IRAS
- jar xvf Java.IRAS.071204.jar
- Use DIR to confirm that there are now a couple dozen files in C:\IRAS, including "Iras.class"
- Start the program using "java -classpath . Iras" Be sure to type the space, period, space after -classpath, and don't type the quotes!


If you have any trouble, you can come back and post your problem in this thread, and I'll help you figure it out.
 
Chad McMullin
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alright I got it to work! Thank You for your time and help.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic