wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Main-Class manifest attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Main-Class manifest attribute" Watch "Main-Class manifest attribute" New topic
Author

Main-Class manifest attribute

Chad McMullin
Greenhorn

Joined: Jul 11, 2004
Posts: 3
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

Joined: Jul 08, 2003
Posts: 24183
    
  34

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.


[Jess in Action][AskingGoodQuestions]
Chad McMullin
Greenhorn

Joined: Jul 11, 2004
Posts: 3
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

Joined: Jul 08, 2003
Posts: 24183
    
  34

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

Joined: Jul 11, 2004
Posts: 3
Alright I got it to work! Thank You for your time and help.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Main-Class manifest attribute
 
Similar Threads
Why can't run?
[SOLVED] Jersey Issue
Manifest file with ant
still cant compile the code
jar and MANIFEST.MF