running a jar
hi
I am using JDK1.2.2 with RedHat Linux 6.2. I tried to run a jar after the jar file creation like this:
jar cmf helloclass hello.jar HelloWorld.class
helloclass is the manifest file which contains the following:
Main-Class: HelloWorld
And i tried to make run the jar file as:
java -jar hello.jar
It says:
Failed to load Main-Class manifest attribute from hello.jar.
I don't know where i am wrong. Please help.
The manifest file can be names to whatever you choose. ("Almost....")
Just make sure that there is a "new-line" charachter at the end of each line.
To be more specific, hit return after each line in the manifest file, else your instructions will be included but not executed.
To make sure that your manifest file is correct. Either extract the files from the jar file, or rename it to .zip and use a zip program to read the file, like WinZip
MagDy at 2007-6-29 8:49:17 >

Manifest-Version: 1.0
Main-Class: net/turingcomplete/phosphor/client/ClientUI
Created-By: 1.2 (turingcomplete.net)
Class-Path: jaxp.jar oro.jar phosphor_help.jar jh.jar media_resources.
jar crimson_mod.jar phosphor_shared.jar ping_icmp.jar desktop_indicat
or.jar m_date_entry.jar phosphor_loadserver.jar phosphor_server.jar
That's a manifest that works.. you can use it as an example. The lines cannot be longer then 72 characters or somthing..