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 编译时在同一个包中找不到类


- 如何使用WebFilter实现授权头检查 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01