Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.lang.NoClassDefFoundError in Mac OS X

843810Jan 25 2005 — edited Jan 27 2005
Just getting started developing in mac OS X and have run into the following error

Exception in thread "main" java.lang.NoClassDefFoundError: testprogram

while trying to run a simple hello world program from the bash shell:

public class testprogram {
public static void main(String[] args){
System.out.println("Hey Zeph it worked!");
}
}


The program compliles fine, but the error occurs when trying to run it. I have a feeling it may have to do with my classpath being incorrect, however they are set as follows:

TERM_PROGRAM=Apple_Terminal
TERM=xterm-color
SHELL=/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin
PWD=/Users/zeph/testprogram
HOME=/Users/zeph
CLASSPATH=/System/Library/Frameworks/JavaVM.Framework/Home

I have been all over the web looking for solutions, most promising being the Getting started tutorial for macs (which is sady out of date and no help at all). Any thoughts would be most appreciated.

Zephyr
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 24 2005
Added on Jan 25 2005
5 comments
831 views