From owner-freebsd-java@FreeBSD.ORG Tue Aug 3 16:17:46 2004 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 114FD16A4CE for ; Tue, 3 Aug 2004 16:17:46 +0000 (GMT) Received: from mail.kanetix.com (kanprd1.kanetix.com [216.220.59.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id E534643D48 for ; Tue, 3 Aug 2004 16:17:45 +0000 (GMT) (envelope-from ean@hedron.org) Received: from [192.168.100.215] (unknown [192.168.100.215]) by mail.kanetix.com (Postfix) with ESMTP id 5C1581D181 for ; Tue, 3 Aug 2004 12:17:45 -0400 (EDT) Message-ID: <410FBAA9.7000600@hedron.org> Date: Tue, 03 Aug 2004 12:17:45 -0400 From: Ean Kingston User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040616 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-java@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: problems running 'Hello World' program. X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2004 16:17:46 -0000 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.