m**********l 发帖数: 10 | 1 hi,all
I'm having problems running my created Java applications from the command
line. The javac command seems to compile the .java file correctly, but when
I try to run the program using the java command, I get this error:
Exception in thread "main" java.lang.NoClassDefFoundError: Box
Caused by: java.lang.ClassNotFoundException: Box
at java.net.URLClassLoader$1.run (URLClassLoader.java: 200)
at java.security.AccessController.doPrivileged(NativeMethod)
at java.net.URLClassLoader.find | A**o 发帖数: 1550 | 2 Quick solution: find a IDE, namely Eclipse/Netbeans/IntelliJ IDEA | s******n 发帖数: 876 | 3 maybe you didn't give java the full class name, including package name.
java a.b.Box
when
【在 m**********l 的大作中提到】 : hi,all : I'm having problems running my created Java applications from the command : line. The javac command seems to compile the .java file correctly, but when : I try to run the program using the java command, I get this error: : Exception in thread "main" java.lang.NoClassDefFoundError: Box : Caused by: java.lang.ClassNotFoundException: Box : at java.net.URLClassLoader$1.run (URLClassLoader.java: 200) : at java.security.AccessController.doPrivileged(NativeMethod) : at java.net.URLClassLoader.find
| z****e 发帖数: 54598 | 4 u need to set the classpath of java
the classpath should include "." which means current folder
when
【在 m**********l 的大作中提到】 : hi,all : I'm having problems running my created Java applications from the command : line. The javac command seems to compile the .java file correctly, but when : I try to run the program using the java command, I get this error: : Exception in thread "main" java.lang.NoClassDefFoundError: Box : Caused by: java.lang.ClassNotFoundException: Box : at java.net.URLClassLoader$1.run (URLClassLoader.java: 200) : at java.security.AccessController.doPrivileged(NativeMethod) : at java.net.URLClassLoader.find
| m**********l 发帖数: 10 | |
|