IntelliJ can#39;t find classes in same package when compiling(IntelliJ 编译时在同一个包中找不到类)
问题描述
作为我上一个问题的扩展(
正如您在图片中看到的那样,在涉及 BifCreatorController 的行中发生了,即使该类与
p>BifCreatorView
位于同一包中.
就像我之前的问题一样,我无法理解 IntellJ 为什么会吐出这些错误.这个项目在 Eclipse 中运行良好,但我希望开始远离 Eclipse.
这是因为 BifCreatorController 被排除在编译之外(参见文件名附近的左上角小X"图标).一个原因是文件在编译时出现了一些错误,IDEA 建议将其从编译中排除,您已接受.
转到文件 > 设置 > 构建、执行、部署 > 编译器 > 排除"并从那里删除它.
As an extension to my previous question (IntelliJ can't find depencency when compiling, but can in editor.) which got solved, I now have a new issue which has sprung up.
Within the same packages, references to other classes are showing up with errors:
As you can see in the picture, there is happening at the line involving the BifCreatorController
, even though that class is in the same package as the BifCreatorView
.
Just like my previous question, I am failing to understand why IntellJ is spitting out those errors. This project works just fine in Eclipse, but I am looking to start moving away from eclipse.
This is because BifCreatorController is excluded from compilation (see the small "X" top-left icon near to the file name). One reason would be the file got some errors while compiling, IDEA proposed to exclude it from compilation and you had accepted.
Go to "File > Settings > Build, Execution, Deployment > Compiler > Excludes" and remove it from there.
这篇关于IntelliJ 编译时在同一个包中找不到类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:IntelliJ 编译时在同一个包中找不到类
基础教程推荐
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 降序排序:Java Map 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01