2009年2月19日星期四

Java: Exception in thread main java.lang.NoClassDefFoundError

Common error that beginning java authors may experience.

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

    You try to run a little java program and you get this blasted error. I first got this error when running our little hello world program.

    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.

http://www.tech-recipes.com/rx/826/java-exception-in-thread-main-javalangnoclassdeffounderror/
--
yaoms

没有评论:

发表评论