英文:
working 'java -cp' not working all of a sudden in ubuntu
问题
我们有以下的Java命令,之前一直运行正常,突然间停止工作了:
java –cp "classes:lib/*" xxx.yyy.ppp
这个jar包在lib目录下,而且jar包中包含了这个类。
突然间它停止工作了,并显示了以下错误:
"Error: Could not find or load main class –cp"
为什么它把 '-cp' 当作了主类,即使 ppp(例如)有主类。请帮我解决这个问题...
英文:
We have the below java command which was running and stopped working all of a sudden,
java –cp "classes:lib/*" xxx.yyy.ppp
The jar is within lib directory and the jar contains the class.
It stopped working all of a sudden and gived the below error,
"Error: Could not find or load main class –cp"
Why is it considering '-cp' as the main class, even though ppp (example) has the main class. Please help me out with this...
答案1
得分: 1
使用此命令而非默认的连字符,在 java -cp "classes:lib/*" xxx.yyy.ppp
前加上连字符:java -cp "classes:lib/*" xxx.yyy.ppp
。
英文:
You are not using a default hypen before cp as java –cp "classes:lib/*" xxx.yyy.ppp
Use this instead : java -cp "classes:lib/*" xxx.yyy.ppp
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论