java运行问题,使用命令java -cp。

huangapple 未分类评论45阅读模式
英文:

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!

huangapple
  • 本文由 发表于 2020年4月9日 22:12:39
  • 转载请务必保留本文链接:https://java.coder-hub.com/61123185.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定