Intellij突然抛出ClassNotFoundException [英] Intellij suddenly throwing ClassNotFoundException

查看:2285
本文介绍了Intellij突然抛出ClassNotFoundException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里完全丧失。我有一个名为LenseProject的外部硬盘驱动器上的项目。在LenseProject中,我有 .idea lib Natives SRC 文件夹。我也有一些文本文件供阅读。



当我昨晚离开工作,这一切都很好。今天早上,我遇到了:

 线程main中的异常java.lang.ClassNotFoundException:QuadTest 
at java.net.URLClassLoader $ 1.run(URLClassLoader.java:366)
在java.net.URLClassLoader $ 1.run(URLClassLoader.java:355)
在java.security.AccessController.doPrivileged (Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc .Launcher $ AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(本地方法)
at java.lang.Class.forName(Class.java:188)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113)

QuadTest是主类。



我认为可能有帮助的信息:




  • 注释掉导入,我得到适当的错误消息。
    (找不到符号等)。


  • 我有9个依赖项,位于lib \lwjgl-2.9.0 \jar在项目结构 - >库中设置


  • 模块具有LenseProject作为内容根目录,SRC作为
    源文件夹


  • 语言级别为7.0

    项目结构 - >模块
    - >依赖关系。


  • 在编译器输出中,我设置为使用模块编译输出路径
    作为继承项目编译输出路径给我无法启动
    编译:没有为模块
    LenseProject指定输出路径。在配置项目中指定输出路径。


  • 我有VM选项 -Djava.library.path = Natives


  • 我可以通过命令提示符编译和运行程序没有问题。


  • 我今天早晨启动时缺少我的配置选项,重新设置SDK和库。



解决方案

- >项目结构 - >模块,然后选择有问题的模块,在路径选项卡中选择更改为使用模块编译输出路径。


I'm at a complete loss here. I have a project on an external hard drive called LenseProject. Inside LenseProject, I have .idea, lib, Natives and SRC folders. I also have a number of text files for reading.

When I left work last night, this all worked fine. Coming in this morning, I'm met with:

Exception in thread "main" java.lang.ClassNotFoundException: QuadTest
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:188)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113) 

QuadTest being the main class.

Information that I think might be helpful:

  • If I comment out the imports, I get the appropriate error messages. (Cannot find symbol, etc).

  • I have 9 dependencies, located in lib\lwjgl-2.9.0\jar that are set up in Project Structure -> Libraries.

  • The module has LenseProject as the content root, and SRC as the source folder.

  • The language level is 7.0

  • I have the dependencies set to export in Project Structure -> Modules -> Dependencies.

  • In Compiler Output, I have it set to Use Module Compile Output Path, as Inherit Project Compile Output Path gave me "Cannot start compilation: The output path is not specified for module "LenseProject". Specify the output path in Configure Project.

  • I have VM option -Djava.library.path=Natives.

  • I can compile and run the program through command prompt no problem.

  • I was missing my configure options when I started it up this morning. I had to set the SDK again, and libraries.

解决方案

Open your Idea File --> Project Structure --> Modules ,and then choose problematic module,in the "Paths" tab change selected to "Use module compile output path ".

这篇关于Intellij突然抛出ClassNotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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