英文:
java running problem with command java -cp
问题
我正在尝试在运行Java代码时添加一个依赖库,就像这样:
javac -cp "/temp/package.jar" myRunningCode.java
java -cp "/temp/package.jar" myRunningCode
第一行的编译工作正常。
但是第二行却给了我这个错误信息:
错误: 找不到或加载主类 myRunningCode'
所以有谁可以帮我解决这个问题吗?
非常感谢!
英文:
I am trying to add a dependent library when running the java code like:
javac -cp "/temp/package.jar" myRunningCode.java
java -cp "/temp/package.jar" myRunningCode
The first line compiling works well.
But the 2nd line gave me the error message:
Error: Could not find or load main class myRunningCode
'
So anyone can help me with this problem?
Thanks a lot!
专注分享java语言的经验与见解,让所有开发者获益!
评论