Hey guys. Sorry for the stupid question, but I can't seem to find the answer anywhere.
Every time I try to run a java program, I get the following error:
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
Looks like java can't find the built in libraries. I know I have to point the $CLASSPATH variable to something, I just don't know what. I've tried "." (current directory) and a few I thought might work in my jre directory, but nada.
Java Home (this is correct) :
Can anyone tell me where I should point $CLASSPATH to make java run?Code:conor@conor-lt:~/Desktop$ echo $JAVA_HOME /usr/java/jre1.5.0_02
Thanks.
If you're using *nothing* but built-in stuff, then your classpath should be figured out based on your java_home variable, iinm.
The trouble usually arises when you try to run a program that needs stuff that isn't built in. Usually, well-behaved java developers will write a wrapper script that sets the appropriate classpath variable and then does the requisite incantations to get things launched. Occasionally, though, they don't, and you're left to figure it out for yourself.
If the app comes with a bunch of jar files, you might have to use an absolute path either to the directory containing those files, or, if it comes with just a few jar files, you can actually use absolute paths to each individual jar file as the classpath (see the -classpath line in the java help output).
If the executable *itself* IS a jar file, run it like "java -jar app.jar"
Bookmarks