problems running 'Hello World' program.

Ean Kingston ean at hedron.org
Tue Aug 3 09:17:46 PDT 2004


Hello all,

I'm just starting to learn to program Java but I have been running and
programming on FreeBSD (and other UNIXish) systems for years.

I can get the program to compile but can't get it to run. The error
messages "Exception in thread "main" java.lang.NoClassDefFoundError:
HelloWorld/class".

I'm running FreeBSD 4.10-Release. I used the ports system to build JDK
1.4.2. I'm using the FreeBSD native jdk (as opposed to the Linux one
that got installed as a prerequisite).

I've tried it with no CLASSPATH, and with several varients of
CLASSPATH=/usr/local/jdk1.4.2/lib:/usr/local/lib/jdk1.4.2/jre/lib:.

I've got /usr/local/jdk1.4.2/bin included in my path to get java and
javac. I've verified (with which) that the correct java and javac are found.

I've compiled it with 'javac -classpath $CLASSPATH HelloWorld.java' and
'javac HelloWorld.java' without success.

I can post the exact code if anyone wants but it is just the code from
the intoductory tutorial on www.java.sun.com with a small name change in
the classname (and hence file name).

I also tried this on Mac OSX (it had jdk 1.3 installed) with the same
result.

Some help (even pointer to the right FAQ) would be appreciated. A Google
search got me looking at the CLASSPATH stuff but nothing else.






More information about the freebsd-java mailing list