Very large java source

Answered

Hello,

I have a problem with a very large java source file (45k lines, 2.2MB). Although the compiler considers it as a java file and compiles it, the interface does not. All code references to this class and imports are in red, and the project explorer tree displays it as a regular file, with the ".java" extension (i.e. "String.java" instead of just "String"), and it has an icon with a "j" drawn on it, instead of the regular class icon (see attached picture). Needless to say, these errors also appear at commit, if code analysis is checked.

So my question is how does IDEA handle very large java sources? Could size be the problem?


My system:
Windows XP SP3
IDEA 8.1.3
Project JDK: Sun JVM 1.6.20 32-bit



Attachment(s):
idea-problem.JPG
6 comments

Hello Ionut,

For performance reasons, IDEA treats Java files larger than a certain size
as plain text. The size can be configured as idea.max.intellisense.filesize
in idea.properties file in IDEA installation directory.

I have a problem with a very large java source file (45k lines,
2.2MB). Although the compiler considers it as a java file and compiles
it, the interface does not. All code references to this class and
imports are in red, and the project explorer tree displays it as a
regular file, with the ".java" extension (i.e. "String.java" instead
of just "String"), and it has an icon with a "j" drawn on it, instead
of the regular class icon (see attached picture). Needless to say,
these errors also appear at commit, if code analysis is checked.

So my question is how does IDEA handle very large java sources? Could
size be the problem?

My system:
Windows XP SP3
IDEA 8.1.3
Project JDK: Sun JVM 1.6.20 32-bit
---
Original message URL:
http://devnet.jetbrains.net/message/5270837#5270837

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


1

I have exactly the same problem. The Java class in question is auto generated on the basis of an Antl4 grammar (official) . Its size is 10.5 MB. 160K lines. I increased idea.max.max.intellisense.filesize.filesize etc... and  although the compiler considers it as a java file and compiles it, the interface does not. All code references to this class and imports are in red, and the project explorer tree displays it as a regular file, with the".java" extension. (same as Ionut) .

Please help!  A million thanks in advance!

Odile

https://github.com/antlr/grammars-v4/tree/master/plsql 

0

Please make sure that you've edited the properties via Help | Edit Custom Properties and the file contains the following:

idea.max.content.load.filesize=30000
idea.max.intellisense.filesize=30000

Don't forget to restart IntelliJ IDEA.

0

Hi Serge,

Yes, I have modified. I also modified the vm options. But it doesn't work.

 

0

I can't reproduce the issue. Make sure the package statement in the files corresponds to the actual files location.

 

Check idea.log for possible errors, make sure IDE doesn't run out of memory. I'd recommend disabling inspections for these huge files:

I'd recommend compiling these large .java files instead. Then remove them from the project and add a .jar library with these compiled classes as a dependency. It will improve the performance a lot.

Here is the sample project that worked for me in IntelliJ IDEA 2018.3.5 and the adjusted idea.properties: https://www.dropbox.com/s/b3clt1a8lyi0tik/plsql.zip?dl=1.

0

Please sign in to leave a comment.