-
Java Linux
java version "1.4.2-01"
Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.4.2-01)
Java HotSpot(TM) 64-Bit Server VM (build Blackdown-1.4.2-01, mixed mode)
Running on Gentoo
Im trying to run a java program that I successfully compiled. Everytime I try and do so I get the following...
Exception in thread "main" java.lang.NoClassDefFoundError: FirstApplet/class
Generally it (google) says this happens when your CLASSPATH isnt defined properly but I've got it point to the right place (/opt/blackdown-jdk-1.4.2.01/lib) and the jar files are in there too (dt.jar htmlconverter.jar ir.idl orb.idl tools.jar)
It doesnt even matter if I try to run a java class that doesnt exist, I still get the same error. It doesn't matter if I run it as a user or root.
Any ideas?
Ta!
edit> CLASSPATH=/opt/blackdown-jdk-1.4.2.01/jre/lib - gives the same error
-
-
-
ok
set CLASS_PATH not CLASSPATH
set it it to call out the individual class names then export CLASSPATH
-
i may be mistaken, but java 1.5 is less stressy about classpaths - i haven't got one set, but 'java -jar foo.jar' works perfectly.
worth a try?
-
actually, what is the EXACT invocation you're using to run your app?
-
You may need to include your JARs on your CLASSPATH explicitly - it's not enough to just include the directory that they resides in. I think JARs that are in the JRE/lib/ext are included by default but I've never been 100% sure on that and I'm not sure if that varies across platforms.
Not a good idea to keep your development JARs in the JRE/SDK tree anyway... but that's by the by..
-
sorry kinda forgot about this, but back at work now so ill give it all a try now
-
hmm, not too sure whats been going on, but everything is working now. I just ran the command I initially ran 'java FirstApplet' and it worked.
Maybe the other IT bod did something, sorry for wasting your time everyone and cheers for the posts