A
Aaron
I have been trying for a couple of days now trying to get this to
work. As the title says I am trying to make a executible jar. As
this is my first attempt (besides the netbeans colorexample tutorial)
it has been a struggle. On top of that, this is not my code but a
project my boss has handed to me.
The general information:
WinXP
Java version 1.4.2
The setup:
Basedir: mainclass.java (contains main) ....<about 30 more .java>
jai_codec.jar plot.jar
subdir: ptolemy (contains two subdirs plot and gui)
subsubdir: gui(uses .java in here)
subsubdir plot (uses .java in here)
from the basedir I compile from command prompt using:
javac -classpath .;jai_codec.jar;plot.jar;ptolemy\plot;ptolemy\gui
*.java
no errors.
then I create the jar:
jar -cf mainclass.jar *.class *.jar ptolemy\plot\*.class
ptolemy\gui\*.class
no errors.
then I add the manifest
jar -umf manifest.mf javapeno.jar
no errors.
When I double click on the jar i recive the very helpful error:
Could not find the main class. Program will exit.
When I try through the command prompt with:
java -jar mainclass
I recieve the error message:
Exception in thread "main" java.util.zip.ZipException: The system
cannot find the file specified
if I use the same command but include the .jar (as some readings I
read somewhere suggested to try) i receive:
Exception in thread "main" java.lang.NoClassDefFoundError:
mainclass/mainclass
I have even tried:
java -jar C:\PATHTOFILE\mainclass
and that produced:
Exception in thread "main" java.util.zip.ZipExceptin: Access is denied
and if I tried it with the .jar exetension that produced the same
results as the last try with the extension.
The manifest.mf file contains:
Main-Class: mainclass.mainclass
Class-Path: .;jai_codec.jar;plot.jar;ptolemy\plot;ptolemy\gui
|BLANK LINE HERE|
I could not find a general agreement as to whether the class-path
actually does anything in it so that is why that is there.
One final note: The program does run as a general java application,
so I am confident in the code, as much as I can be without have
written it.
As I said this is my first time dealing with jars so please do not
skip trivial steps in whatever help you may provide and please be
patient with my attempts.
Aaron
work. As the title says I am trying to make a executible jar. As
this is my first attempt (besides the netbeans colorexample tutorial)
it has been a struggle. On top of that, this is not my code but a
project my boss has handed to me.
The general information:
WinXP
Java version 1.4.2
The setup:
Basedir: mainclass.java (contains main) ....<about 30 more .java>
jai_codec.jar plot.jar
subdir: ptolemy (contains two subdirs plot and gui)
subsubdir: gui(uses .java in here)
subsubdir plot (uses .java in here)
from the basedir I compile from command prompt using:
javac -classpath .;jai_codec.jar;plot.jar;ptolemy\plot;ptolemy\gui
*.java
no errors.
then I create the jar:
jar -cf mainclass.jar *.class *.jar ptolemy\plot\*.class
ptolemy\gui\*.class
no errors.
then I add the manifest
jar -umf manifest.mf javapeno.jar
no errors.
When I double click on the jar i recive the very helpful error:
Could not find the main class. Program will exit.
When I try through the command prompt with:
java -jar mainclass
I recieve the error message:
Exception in thread "main" java.util.zip.ZipException: The system
cannot find the file specified
if I use the same command but include the .jar (as some readings I
read somewhere suggested to try) i receive:
Exception in thread "main" java.lang.NoClassDefFoundError:
mainclass/mainclass
I have even tried:
java -jar C:\PATHTOFILE\mainclass
and that produced:
Exception in thread "main" java.util.zip.ZipExceptin: Access is denied
and if I tried it with the .jar exetension that produced the same
results as the last try with the extension.
The manifest.mf file contains:
Main-Class: mainclass.mainclass
Class-Path: .;jai_codec.jar;plot.jar;ptolemy\plot;ptolemy\gui
|BLANK LINE HERE|
I could not find a general agreement as to whether the class-path
actually does anything in it so that is why that is there.
One final note: The program does run as a general java application,
so I am confident in the code, as much as I can be without have
written it.
As I said this is my first time dealing with jars so please do not
skip trivial steps in whatever help you may provide and please be
patient with my attempts.
Aaron