[英]IntelliJ: cannot launch a java application using the command line
Let me summarize the problem:让我总结一下问题:
java Main
I would get my Main.java/class
application back.java Main
时,我都会恢复我的Main.java/class
应用程序。java Main
, I'd have to type java Main.java
.java Main.java
而不是使用java Main
I thought that it was due to a recent build for the JDK (v14.02), so I let that one pass.Error: Could not find or load main class com.pluralsight.organized.Main. Caused by: java.lang.ClassNotFoundException: com.pluralsight.organized.Main
Error: Could not find or load main class com.pluralsight.organized.Main. Caused by: java.lang.ClassNotFoundException: com.pluralsight.organized.Main
Error: Could not find or load main class com.pluralsight.organized.Main. Caused by: java.lang.ClassNotFoundException: com.pluralsight.organized.Main
. Error: Could not find or load main class com.pluralsight.organized.Main. Caused by: java.lang.ClassNotFoundException: com.pluralsight.organized.Main
。 The folder structure should be: D:/SomePath/com/example/Main.class
Then you need to be at D:/SomePath/
to execute java com.example.Main
.文件夹结构应该是:
D:/SomePath/com/example/Main.class
然后你需要在D:/SomePath/
执行java com.example.Main
。 Alternatively, you could be anywhere else and execute java -cp D:/SomePath com.example.Main
.或者,您可以在其他任何地方执行
java -cp D:/SomePath com.example.Main
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.