java.lang.NoClassDefFoundError

java.lang.NoClassDefFoundError:

This occurs because the classpath is not setup or referenced correctly.

Executing your program using this command should correct the problem:
java -classpath . helloworld

where helloworld is the name of your compiled class.

This tells java that your classpath is your local directory.