IntelliJ找不到任何声明 [英] IntelliJ cannot find any declarations

查看:1024
本文介绍了IntelliJ找不到任何声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我完全卸载了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屋!

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