Re: How do you execute a JAR file?





On Jan 28, 2:57 pm, Knute Johnson <nos...@xxxxxxxxxxxxxxxxxxxxxxx>
wrote:
phillip.s.pow...@xxxxxxxxx wrote:

On Jan 28, 2:27 pm, Knute Johnson <nos...@xxxxxxxxxxxxxxxxxxxxxxx>
wrote:
phillip.s.pow...@xxxxxxxxx wrote:

On Jan 28, 1:00 pm, Knute Johnson <nos...@xxxxxxxxxxxxxxxxxxxxxxx>
wrote:
phillip.s.pow...@xxxxxxxxx wrote:
On Jan 28, 9:51 am, "cp" <e-bl...@xxxxxxxxxxxxxxxxxxxxx> wrote:
Executing a JAR file under windows is typically done:
java -jar name.jar
Where name is the name of the file and you, of course, stand in the correct
directory.
Yes, I did exactly that:
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
no effect when the -jar option is specified. Try compiling a simple
program from the command line and then run it. That should help you
find the problem.
I found out that apparently that's defined within manifest.mf, so here
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
IconMaker?

The main class is called "IconMaker", in a "default package" that
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
default package or IconMaker needs to be in the GUI package. And you
need to recompile and re jar it.

Thanx, however, there is no GUI package, there is a GUI project,
however, created by the other NetBeans. I

--

Knute Johnson
email s/nospam/knute/

.



Relevant Pages

  • Re: Issues developing SE and EE on same machine netbeans
    ... Whether you can have two different edition sof NetBeans running on the ... There is no danger of mixup between Java EE JARs and Java SE JARs. ... There is danger of mixing up different versions of the same JAR, for example, third-party libraries often include a particular version of log4j that may differ from your own preferred version. ...
    (comp.lang.java.programmer)
  • Re: Issues developing SE and EE on same machine netbeans
    ... You can develop Java SE code when developing Java EE. ... Whether you can have two different edition sof NetBeans running on the ... There is no danger of mixup between Java EE JARs and Java SE JARs. ... third-party libraries often include a particular version of log4j that may ...
    (comp.lang.java.programmer)
  • Re: How do you execute a JAR file?
    ... java -jar GUI.jar ... Knute Johnson ... remains unnamed by NetBeans, however, when it "jars" up the Main-Class ... Thanx, however, there is no GUI package, there is a GUI project, however, created by the other NetBeans. ...
    (comp.lang.java.help)
  • Re: A constructive debate: Eclipse or NetBeans?
    ... However, I've tried NetBeans recently. ... better support for creating GUIs than Eclipse ... "make" as a build system and primarily programming in OCaml. ... Sun's Java implementation. ...
    (comp.lang.java.softwaretools)
  • Netbeans6 - Javas own "Vista experience" ?
    ... I'm but a Java programmer and not even a veteran at that. ... I started using Netbeans 4.x and immediatly adopted it ... you'll see is a lightbulb which warns you about missing javadocs. ...
    (comp.lang.java.advocacy)