Re: How do you execute a JAR file?
- From: Knute Johnson <nospam@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 28 Jan 2007 13:45:02 -0800
phillip.s.powell@xxxxxxxxx wrote:
On Jan 28, 4:33 pm, Knute Johnson <nos...@xxxxxxxxxxxxxxxxxxxxxxx> wrote:phillip.s.pow...@xxxxxxxxx wrote:
On Jan 28, 4:12 pm, Knute Johnson <nos...@xxxxxxxxxxxxxxxxxxxxxxx>of writing a java program. But I guarantee you that you have a
wrote:
phillip.s.pow...@xxxxxxxxx wrote:It also didn't work if I tried extracting the JAR file, editingOn Jan 28, 2:57 pm, Knute Johnson <nos...@xxxxxxxxxxxxxxxxxxxxxxx>for GUI.IconMaker and you have IconMaker. It is never going to work.
wrote:
phillip.s.pow...@xxxxxxxxx wrote:Thanx, however, there is no GUI package, there is a GUI project,On Jan 28, 2:27 pm, Knute Johnson <nos...@xxxxxxxxxxxxxxxxxxxxxxx>default package or IconMaker needs to be in the GUI package. And you
wrote:
phillip.s.pow...@xxxxxxxxx wrote:The main class is called "IconMaker", in a "default package" thatOn Jan 28, 1:00 pm, Knute Johnson <nos...@xxxxxxxxxxxxxxxxxxxxxxx>IconMaker?
wrote:
phillip.s.pow...@xxxxxxxxx wrote:I found out that apparently that's defined within manifest.mf, so hereOn Jan 28, 9:51 am, "cp" <e-bl...@xxxxxxxxxxxxxxxxxxxxx> wrote:no effect when the -jar option is specified. Try compiling a simpleExecuting a JAR file under windows is typically done:Yes, I did exactly that:
java -jar name.jar
Where name is the name of the file and you, of course, stand in the correct
directory.
cd "C:\Program Files\Java\jdk1.6.0\classes"
java -jar GUI.jar
To no avail, I still get NoClassDefFoundErrorThe CLASSPATH environment variable and the -cp command line option have
program from the command line and then run it. That should help you
find the problem.
is manifest.mf:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.6.0-b105 (Sun Microsystems Inc.)
Main-Class: GUI.IconMaker
Class-Path:
X-COMMENT: Main-Class will be added automatically by build
It appears Class-Path is undefined, or what does this mean?
See: http://knutejohnson.com/classpath.html
--
Knute Johnson
email s/nospam/knute/Do you have a package problem? Is the main class GUI.IconMaker or
remains unnamed by NetBeans, however, when it "jars" up the Main-Class
becomes "GUI.IconMaker". And yes, I tried both, to no avail. Again,
works beautifully on NetBeans on my machine at work, bombs completely
when I try to use it on the exact same setup at home
--
Knute Johnson
email s/nospam/knute/That's where your problem is then. You need to put it all in the
need to recompile and re jar it.
however, created by the other NetBeans. I
--
Knute Johnson
email s/nospam/knute/Well whatever it is that is the problem. The manifest file says to look
manifest.mf to have Main-Class = "IconMaker" and then re-JAR it back
together again, then I get a totally different error:
Failed to load Main-Class manifest attribute from GUI.jar
It works if you expand it out to individual classes.
--
Knute Johnson
email s/nospam/knute/This whole package/jar/manifest/classpath is the most complicated part
disagreement between one of these things that is preventing you from
running your program.
Try extracting all of the classes to a directory, change into that
directory and jar them with the following:
jar -cvfe test.jar IconMaker *.class
Then try running that with:
java -jar test.jar
and let me know what happens.
Now I get "NoClassDefFoundError: ImageTools/ImageDownloadable"
ImageTools should be a subdirectory of the folder where IconMaker.class is found
--
Knute Johnson
email s/nospam/knute/
And ImageTools isn't in your jar file? That will stop it from working. You've got more than one problem going on here. You need all of the source and you need to put it in a package structure before you compile and jar it.
--
Knute Johnson
email s/nospam/knute/
.
- Follow-Ups:
- Re: How do you execute a JAR file?
- From: phillip.s.powell@xxxxxxxxx
- Re: How do you execute a JAR file?
- References:
- How do you execute a JAR file?
- From: phillip.s.powell@xxxxxxxxx
- Re: How do you execute a JAR file?
- From: cp
- Re: How do you execute a JAR file?
- From: phillip.s.powell@xxxxxxxxx
- Re: How do you execute a JAR file?
- From: Knute Johnson
- Re: How do you execute a JAR file?
- From: phillip.s.powell@xxxxxxxxx
- Re: How do you execute a JAR file?
- From: Knute Johnson
- Re: How do you execute a JAR file?
- From: phillip.s.powell@xxxxxxxxx
- Re: How do you execute a JAR file?
- From: Knute Johnson
- Re: How do you execute a JAR file?
- From: phillip.s.powell@xxxxxxxxx
- Re: How do you execute a JAR file?
- From: Knute Johnson
- Re: How do you execute a JAR file?
- From: phillip.s.powell@xxxxxxxxx
- Re: How do you execute a JAR file?
- From: Knute Johnson
- Re: How do you execute a JAR file?
- From: phillip.s.powell@xxxxxxxxx
- How do you execute a JAR file?
- Prev by Date: Re: How to detect blank input using Scanner?
- Next by Date: Re: How to detect blank input using Scanner?
- Previous by thread: Re: How do you execute a JAR file?
- Next by thread: Re: How do you execute a JAR file?
- Index(es):
Relevant Pages
|