Problems creating a jar executable file...

Hi there, I am new to these forums, my name is Jay.

I am trying to create an executable .jar file for my program I created in JBuilder 2005, with java files and several other files as well. I am having MAJOR problems with either the main class not being found or failing to load Main-Class manifest attribute.

I tried to make a .txt with two lines, including the first with the MAIN-CLASS: className and stuff and a second line blank, and use the cmf command line to run it and include it in there. I ran it and created it no problem, but then I try to run it, and I get the error of the main class not being found and I have specified the correct directory and class name.

Then I try to make my own manifest file with the correct directory and class name by making a txt file into an .mf file and when I try the cf command line this time, it gives me the error of failing to load Main-Class manifest attribute.

I have even followed the tutorials on the Sun developer website including Manifest making and stuff and everything.

I have worked on this program (java) for months and I am now STUCK. If someone could maybe give me some assistance or suggestions as to what my problem might be, I would greatly appreciate it so much. Or if you want, you can e-mail me, @ rjs_bird@yahoo.com with suggestions. Thank you all very much.

I have a folder in a directory. It's called SuperPassword, which is the folder where my project files and EVERYTHING is. my .class files are in the classes/superpassword subdirectory of the folder SuperPassword, my java files are in the src/superpassword subdirectory and my manifest file and txt files are in the SuperPassword main directory. Maybe that could give you guys a bit of a hint as to what I am dealing with, I want to explain it as clearly as possible.

Jay

[1847 byte] By [RJSBird287a] at [2007-10-2 5:48:41]
# 1

> I have a folder in a directory. It's called

> SuperPassword, which is the folder where my project

> files and EVERYTHING is. my .class files are in the

> classes/superpassword subdirectory of the folder

> SuperPassword, my java files are in the

> src/superpassword subdirectory and my manifest file

> and txt files are in the SuperPassword main

> directory. Maybe that could give you guys a bit of a

> hint as to what I am dealing with, I want to explain

> it as clearly as possible.

>

> Jay

So I guess you have a directory path SuperPassword\classes\superpassword and the .class files are inside. Are the classes in a superpassword package? If they are, then the Main-Class must be something like "superpassword.MainClass" and when you jar the .class files you need to make sure they are in a superpassword directory inside the jar - like "jar cmf thejar.jar themanifest.txt superpassword\*.class"

You can check the directory structure by displaying the contents of the jar using "jar tf thejar.jar"

Also, remember that java is case sensitive.

atmguya at 2007-7-16 1:58:12 > top of Java-index,Desktop,Deploying...
# 2
WOW! It worked, I knew I wasn't doing something right. It's the CLASS files you need, not the JAVA files, thanks a lot, atmguy, you're awesome!
RJSBird287a at 2007-7-16 1:58:12 > top of Java-index,Desktop,Deploying...
# 3
Glad I was able to help you.
atmguya at 2007-7-16 1:58:12 > top of Java-index,Desktop,Deploying...