Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Aug 2004 12:17:45 -0400
From:      Ean Kingston <ean@hedron.org>
To:        freebsd-java@freebsd.org
Subject:   problems running 'Hello World' program.
Message-ID:  <410FBAA9.7000600@hedron.org>

next in thread | raw e-mail | index | archive | help
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.






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?410FBAA9.7000600>