java.lang.NoClassDefFoundError in Mac OS X
843810Jan 25 2005 — edited Jan 27 2005Just 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