Results 1 to 2 of 2
Thread: Jar file error. Please help!
- 02-11-2010, 02:21 AM #1Member
- Join Date
- Feb 2010
- Rep Power
Jar file error. Please help!
Hey I'm not that new to Java, but recently I've been looking into how to create a jar file. I have the manifest and the program I'm trying to convert to .jar is only a main class, no other additional classes are included. It is compiled and the manifest is where it's supposed to be, but when I click on the jar file I get a error that says:
Could not find the main class: *****. Program will exit.
Could anyone help me and tell me what I'm doing wrong?
- 02-11-2010, 03:19 AM #2
likely, you are not invoking the jar command with the "m" option to specify "use this manifest file I have here" . without telling jar to use your own manifesst, creating a jar file of a folder structure that includes the META-INF/MANIFEST.MF file right there in the folder, the jar command will quite irritatingly just hapily go and create its own default manifest file in the jar, which would not have your Main-Class property that is needed here.
To verify this is the case, create the jar, then create some temporary folder, and extract the jar into this spot, and look at the manifest file.
So try invoking jar like:
jar cmf manifest ExecutableJar.jar application-dir
- By sarang1 in forum Advanced JavaReplies: 6Last Post: 02-10-2011, 09:55 AM
- By email@example.com in forum Advanced JavaReplies: 1Last Post: 10-14-2008, 02:26 PM
- By jegadeeshsp in forum Advanced JavaReplies: 2Last Post: 08-20-2008, 05:13 AM
- By Mr tuition in forum AWT / SwingReplies: 1Last Post: 01-16-2008, 12:39 AM
- By vikain in forum Advanced JavaReplies: 5Last Post: 01-02-2008, 04:38 AM