Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse 无法让IntelliJ识别原始编译的Java类文件_Eclipse_Intellij Idea_Protobuf C - Fatal编程技术网

Eclipse 无法让IntelliJ识别原始编译的Java类文件

Eclipse 无法让IntelliJ识别原始编译的Java类文件,eclipse,intellij-idea,protobuf-c,Eclipse,Intellij Idea,Protobuf C,我们的项目中有build.xml,但IntelliJ无法从中导入。我得到一个: Cannot import anything from <path_to>/build.xml file. 并选择顶级文件夹。我在IJ也这么做了。该项目导入和索引良好,我可以做任何类搜索。但是,它不能识别protobuf编译的类文件。我安装了proto插件,因此它的语法突出显示了我的.proto文件,但仍然没有意识到它需要引用一个编译的类输出。我需要做一些特殊的事情才能让它识别这些文件吗?因为这几乎是我

我们的项目中有build.xml,但IntelliJ无法从中导入。我得到一个:

Cannot import anything from <path_to>/build.xml file.

并选择顶级文件夹。我在IJ也这么做了。该项目导入和索引良好,我可以做任何类搜索。但是,它不能识别protobuf编译的类文件。我安装了proto插件,因此它的语法突出显示了我的.proto文件,但仍然没有意识到它需要引用一个编译的类输出。我需要做一些特殊的事情才能让它识别这些文件吗?

因为这几乎是我能找到Idea所面临问题的确切描述的唯一地方,所以即使这是一个老问题,我也会回答

结果表明,如果协议缓冲区编译器生成的
.java
文件大于2.5MB(默认设置),Idea将完全忽略它。即使有一个
.class
文件,即使编译/生成成功,即使使用Maven构建的项目很好

要解决此问题,只需编辑您的
idea.properties
文件(它位于idea安装文件夹中的
bin
文件夹中),然后注释掉此设置,或者将其设置为大于生成的
.java
文件的值(在我的例子中,我将其设置为
15000
,因为我生成的文件当前大小约为8MB):


注意:至少在Linux上,默认的更新策略似乎是“用刚下载的内容覆盖旧的Idea文件夹”,每次更新/升级后都必须应用此更改。

是Michele答案的扩展

Mac中没有bin文件夹

在macOS中,当Intellij无法识别原始编译的Java类文件时

从“帮助”菜单中--->选择“编辑自定义属性”。它可能会要求您在下创建
idea.Properties
文件

$HOME//Library/Application\ Support/JetBrains/IdeaIC2020.1/

创建idea.max.intellisense.filesize=2500属性,并设置该值以适应IntelliJ识别的大型原始编译文件。

对我也适用,但我仍然发现该文档令人困惑。我不想在编辑器中打开该文件,也不想获得代码帮助。相反,我想避免代码助理如果我碰巧在idea中意外打开文件,以避免崩溃/阻止它。是否有任何方法可以独立于编辑器中的代码帮助限制来配置编译限制?花了几个小时试图解决这个问题,非常感谢!macos中有
bin
文件夹在应用程序中按右键单击idea打开文件夹并选择“显示包裹内容”
#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE should provide code assistance for.
# The larger file is the slower its editor works and higher overall system memory requirements are
# if code assistance is enabled. Remove this property or set to very large number if you need
# code assistance for any files available regardless their size.
#---------------------------------------------------------------------
idea.max.intellisense.filesize=2500
$HOME//Library/Application\ Support/JetBrains/IdeaIC2020.1/