线程“main”中的异常抛出java.lang.ClassNotFoundException: [英] Exception in thread "main" java.lang.ClassNotFoundException:

查看:3977
本文介绍了线程“main”中的异常抛出java.lang.ClassNotFoundException:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了intellij IDEA 14.0并确保一切正常,我创建了一个简单的Hello World程序。我不明白为什么输出不正确以及为什么我收到此错误。如果有人可以请求帮助那就太棒了。

I recently installed intellij IDEA 14.0 and to make sure everything was working I created a simple Hello World program. 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.

这是该计划:

public class Hello {
  public static void main(String[] args) {
    System.out.println("Hello World!");
  }
}

这是错误:

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)


推荐答案

这只是intellij IDE的问题。

This is just problem of intellij IDE.

解决方案步骤:


  1. CTRL + SHIFT + ALT + s - > 预设设置 - > 模块标签 - > 展开< project_name> 并转到< project_name> _main

  2. 参考图片:

  3. 在来源标签中 - > **点击x符号**

  1. CTRL + SHIFT + ALT + s -> Preject Setting -> modules tab -> expand <project_name> and go to <project_name>_main
  2. refer Image:
  3. In Sources tab -> ** click on x symbol**


  1. 点击是

  2. 右键单击 - > 来源

  3. 申请并确认

最后建立你的项目。

享受。

这篇关于线程“main”中的异常抛出java.lang.ClassNotFoundException:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆