avatar
m*l
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
avatar
A*o
2
Quick solution: find a IDE, namely Eclipse/Netbeans/IntelliJ IDEA
avatar
s*n
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

avatar
z*e
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

avatar
m*l
5
Thanks all, great help!
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。