IntelliJ找不到任何声明 [英] IntelliJ cannot find any declarations
问题描述
我完全卸载了IntelliJ,现在重新安装并导入了我的项目。我使用gradle导入,可以看到项目中的所有文件。但是,当我打开文件时,我无法通过cmd +单击找到任何声明。我有Java 7 SDK设置,我甚至无法在我自己的项目中进行类声明。转到Java核心类,如 String
或 List
也不起作用。如何让IDE能够找到我的类?
I completely uninstalled IntelliJ and have now reinstalled and imported my project. I imported using gradle and can see all of the files in my project present. However, when I open a file I can't find any declaration to go to by doing cmd + click. I have the Java 7 SDK setup, and I can't even go to the declaration of classes in my own project. Going to a Java core class like String
or List
doesn't work either. How can I enable the IDE to be able to find my classes?
我在OSX Yosemite,IntelliJ 2016.1.2 build 145.972。
I'm on OSX Yosemite, IntelliJ 2016.1.2 build 145.972.
推荐答案
我遇到了同样的问题,@ AniaG在评论中的解决方案对我有用。
I had this same problem, and @AniaG's solution in the comments worked for me.
- 右键单击
src
文件夹 - 将目录标记为> 来源根
- Right-click
src
folder - Mark Directory as > Sources Root
这篇关于IntelliJ找不到任何声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!