recommended IDE for developing openjdk?
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Wed Jan 20 12:26:26 UTC 2021
Hi Pavel,
Here are three observations on configuring the JDK project in IntelliJ IDEA.
1. A folder can be present or absent in the "Excluded Folders" list. This list sits below the "+ Add Content Root" button on the right-hand side of the "Project Structure / Project Settings / Modules" window. The list's entries are of brown-red color. (Note: if the list is empty, it doesn't display its title "Excluded Folders" making it impossible to locate.)
Gotcha - I can see the excluded folders
2. The icon of a folder can be displayed in a bleak orange color; selecting such a folder causes the "Excluded" toggle to become pressed. This toggle is the rightmost toggle from the "Mark as:" label on the "Project Structure / Project Settings / Modules" window.
Yup - this is what I normally use to exclude folders "on the fly".
3. It seems that a folder can be both "Excluded" (2) and absent in "Excluded Folders" (1). For example, this is the case for the `build/macosx-x86_64-server-release` folder. If you delete the corresponding entry from "Excluded Folders" (1), that folder will stay "Excluded" (2). I believe this is because that folder is specified in the "Project compiler output" field on the "Project Structure / Project Settings / Project" window and, thus, is excluded implicitly.
Here my head starts spinning - different exclusion mechanisms, partially overlapping?
If we assume that being "Excluded" (2) implies that a folder is not indexed, then we could piggyback on (3) and simply delete the corresponding entry from "Excluded Folders" (1). I do that by pressing a cross-shaped, gray "Include" button on the corresponding entry and then press the "Apply" button on the window. That causes IDE to familiarize itself with the contents of `build/macosx-x86_64-server-release/support/gensrc/java.base`: symbols in editor are no longer of red color with a "Cannot resolve symbol ... " tooltip.
I tried doing just that, but opening e.g. ByteBuffer with CTRL+N just doesn't work. But... you are right in that there's an hidden dependencies between the "Project Output" path and this quirky behavior. If I set "Project Output" to some other folder (e.g. somewhere other than "build") then indexing starts to work as it should... maybe a simple fix can be developed for this...
Cheers
Maurizio
________________________________
From: Pavel Rappo <pavel.rappo at oracle.com>
Sent: Tuesday, January 19, 2021 5:33 PM
To: Maurizio Cimadamore <maurizio.cimadamore at oracle.com>
Cc: Langer, Christoph <christoph.langer at sap.com>; Clemens Eisserer <linuxhippy at gmail.com>; discuss at openjdk.java.net <discuss at openjdk.java.net>; ide-support-dev at openjdk.java.net <ide-support-dev at openjdk.java.net>; Jan Lahoda <jan.lahoda at oracle.com>
Subject: Re: recommended IDE for developing openjdk?
Maurizio,
Here are three observations on configuring the JDK project in IntelliJ IDEA.
1. A folder can be present or absent in the "Excluded Folders" list. This list sits below the "+ Add Content Root" button on the right-hand side of the "Project Structure / Project Settings / Modules" window. The list's entries are of brown-red color. (Note: if the list is empty, it doesn't display its title "Excluded Folders" making it impossible to locate.)
2. The icon of a folder can be displayed in a bleak orange color; selecting such a folder causes the "Excluded" toggle to become pressed. This toggle is the rightmost toggle from the "Mark as:" label on the "Project Structure / Project Settings / Modules" window.
3. It seems that a folder can be both "Excluded" (2) and absent in "Excluded Folders" (1). For example, this is the case for the `build/macosx-x86_64-server-release` folder. If you delete the corresponding entry from "Excluded Folders" (1), that folder will stay "Excluded" (2). I believe this is because that folder is specified in the "Project compiler output" field on the "Project Structure / Project Settings / Project" window and, thus, is excluded implicitly.
If we assume that being "Excluded" (2) implies that a folder is not indexed, then we could piggyback on (3) and simply delete the corresponding entry from "Excluded Folders" (1). I do that by pressing a cross-shaped, gray "Include" button on the corresponding entry and then press the "Apply" button on the window. That causes IDE to familiarize itself with the contents of `build/macosx-x86_64-server-release/support/gensrc/java.base`: symbols in editor are no longer of red color with a "Cannot resolve symbol ... " tooltip.
I'm not sure how this tweak affects indexing though.
-Pavel
> On 18/01/2021 11:49, Pavel Rappo wrote:
>> I note that the last time I configured IntelliJ IDEA for `openjdk/jdk` using a procedure similar to the one that Maurizio has just described, I had to tweak inclusion of generated source.
>>
>> IIRC, after the `idea.sh` script completed, I opened the project it created and went to "File > Project Structure... Project Settings > Modules > Add Content Root" to fix up the way `support/gensrc/java.base` was included. Before I did that, IntelliJ IDEA couldn't see `java.nio.ByteBuffer` and friends.
>>
>> There's always a chance that I followed the reference procedure incorrectly since I haven't seen others complaining about having had to do similar tweaks.
> Hi Pavel,
>
> this is also what I do.
>
> I believe the problem is a consequence of something Chris and I have tried early on as a way to reduce indexing time of the project - e.g. a long time was spent indexing files in the build folder - so we excluded that. The project also re-add generated sources folders - but since these occur inside an excluded folder, it seems like the IDE gets confused.
>
> I tried your trick of adding a new content folder and, while clever, it doesn't seem to help - e.g. as long as the build folder is excluded, the IDE cannot see the generated files when try to open a class (e.g. CTRL + N).
>
> Maurizio
More information about the ide-support-dev
mailing list