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.
--
yaoms
没有评论:
发表评论