[英]Exception in thread “main” java.lang.ClassNotFoundException:
I recently installed intellij IDEA 14.0 and to make sure everything was working I created a simple Hello World program. 我最近安装了intellij IDEA 14.0并确保一切正常,我创建了一个简单的Hello World程序。 I do not understand why the output is not correct and why I am getting this error. 我不明白为什么输出不正确以及为什么我收到此错误。 If someone could please help that would be great. 如果有人可以请求帮助,这将是伟大的。
This is the program: 这是该计划:
public class Hello {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
This is the error: 这是错误:
Exception in thread "main" java.lang.ClassNotFoundException: Hello
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:260)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:116)
您收到此错误的原因是您没有将该类保存到名为Hello.java
的文件中(区分大小写!)
This is just problem of intellij IDE. 这只是intellij IDE的问题。
Solution Steps: 解决步骤:
<project_name>
and go to <project_name>_main
按Ctrl 组合键 Shift Alt 秒 - > Preject设置 - > 模块选项卡 - > 展开<project_name>
并转到<project_name>_main
Finally build your project. 最后建立你的项目。
Enjoy. 请享用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.