Quick question: How to make a JAR file

Well I have jdk1.5.0_02/bin/jar.exe file into my file with all of my classes which work using my schools java editing program. I'm trying to get it to run and I have my manifest.txt with "Main-Class: Driver" in it. Driver is my class with "public static void main(String args[])" in it and I have the cariage return in the manifest.txt file. Thanks for the help.

[370 byte] By [PaulTRa] at [2007-10-2 5:24:32]
# 1

> Well I have jdk1.5.0_02/bin/jar.exe file into my file

> with all of my classes which work using my schools

> java editing program. I'm trying to get it to run and

> I have my manifest.txt with "Main-Class: Driver" in

> it. Driver is my class with "public static void

> main(String args[])" in it and I have the cariage

> return in the manifest.txt file. Thanks for the help.

What is the problem? You told us what your are trying to do, not what is happening. If you get an error, you better post it. You could also post the command you are using.

atmguya at 2007-7-16 1:26:23 > top of Java-index,Desktop,Deploying...
# 2
'jar cmf manifest.txt Project.jar *.class' is the command I type and it just won't open the command prompt which is what the program runs in. I also tried 'jar cf Project.jar *.class' It creates a .jar file but it won't open up.
PaulTRa at 2007-7-16 1:26:23 > top of Java-index,Desktop,Deploying...
# 3

Are you trying to create an executable jar? Do you have a Main-Class in the manifest? You should have blank line (just a carriage return) at the end of the manifest.

Are you trying to run the jar by double-clicking and that is what is not working? If so, try running it from the command line "java -jar the_jar.jar" If nothing else, it should give you an error message.

atmguya at 2007-7-16 1:26:23 > top of Java-index,Desktop,Deploying...
# 4
Note that unless the program in the jar creates a GUI, double-clicking on the jar to run it doesn't do anything - after all, you're in a GUI, not a commandline environment when you do that.
ChuckBinga at 2007-7-16 1:26:24 > top of Java-index,Desktop,Deploying...
# 5
To run the main class in a jar you should use:java -jar my.jar.The jar commands is used to create and edit jars.You can find more info at http://java.sun.com/j2se/1.5.0/docs/tooldocs/index.html#basic.
beradriana at 2007-7-16 1:26:24 > top of Java-index,Desktop,Deploying...
# 6
The manifest should be .mf as well if i'm not mistaken....unless it automatically changes it to in command line compiling.Wes
wes_614a at 2007-7-16 1:26:24 > top of Java-index,Desktop,Deploying...