From christoph.langer at sap.com Mon Jan 18 09:46:02 2021 From: christoph.langer at sap.com (Langer, Christoph) Date: Mon, 18 Jan 2021 09:46:02 +0000 Subject: recommended IDE for developing openjdk? In-Reply-To: References: Message-ID: Hi Clemens, while I won't argue about the fanciness of the Eclipse user interface (??), I'd like to point you to a set of Eclipse projects that I created nevertheless... You'll find them here: https://github.com/RealCLanger/OpenJDKEclipseProjects The main benefit of these Eclipse projects is that the projects for all modules and tests are linked together so you will immediately recognize errors in dependencies. I think that doesn't work so well with IntelliJ. Another hint: There's a mailing list called ide-support-dev where questions around IDE support can get discussed. Best regards Christoph > -----Original Message----- > From: discuss On Behalf Of Clemens > Eisserer > Sent: Freitag, 15. Januar 2021 21:33 > To: discuss at openjdk.java.net > Subject: recommended IDE for developing openjdk? > > Hi, > > About 10 years ago I used eclipse to work on OpenJDK, however I would like > to get rid of it because of its slow/ugly user interface. > I wonder, are there any recommendations which IDE to use these days? > I gave IntelliJ a try but having not used it that much (except for some > fairly standard maven based projects) I failed to configure it correctly, > however I haven't tried Netbeans still. > > So to make it short: Which IDE is known to cope well with working on the > OpenJDK codebase? > And are there detailed instructions available for creating an openjdk > project with intellij? > Or would I be better off using netbeans? > > Thank, Clemens From maurizio.cimadamore at oracle.com Mon Jan 18 11:11:06 2021 From: maurizio.cimadamore at oracle.com (Maurizio Cimadamore) Date: Mon, 18 Jan 2021 11:11:06 +0000 Subject: recommended IDE for developing openjdk? In-Reply-To: References: Message-ID: Hi, thanks for the pointer to the Eclipse project - I'm sure folks will find that useful. I think these days the IntelliJ support is relatively polished - there are features missing yes (for instance the project is monolitic, and not modularized, but folks here are using it pretty regularly and I can't say that has been a huge issue so far). To get started with intellij you have to create an IDE configuration first. 1. first run `sh configure` as you normally would to set up your JDK build - that build configuration would then be reused by Intellij 2. then run `sh bin/idea.sh - e.g. `sh bin/idea.sh java.base jdk.compiler java.desktop` - this will create an `.idea` folder in the current directory and set the sources for the JDK modules you specified. 3. open IntelliJ and point it to the folder where the `.idea` folder has been created. If everything worked correctly you should have a project up and running. The base project supports actions for cleaning, rebuilding the selected modules, or building a JDK image. Optionally, you can also build and install a jtreg plugin, to run and debug tests: https://openjdk.java.net/jtreg/intellij-plugin.html I use this setup on a daily basis and I think it works pretty well - there are things that can be improved (for instance, I don't think the generated sources are always recognized correctly, we need to look into that), but I'm quite productive with it (especially with the jtreg plugin enabled). I know that there is also some limited support for VSCode (especially for hotspot development): https://github.com/openjdk/jdk/blob/master/doc/ide.md And that there is Netbeans support as well - CC'ing Jan who knows more than I do on how to get started there. Eventually we should collect all this info in a single place, but I never found the time to do so. Apologies! Cheers Maurizio On 18/01/2021 09:46, Langer, Christoph wrote: > Hi Clemens, > > while I won't argue about the fanciness of the Eclipse user interface (??), I'd like to point you to a set of Eclipse projects that I created nevertheless... > > You'll find them here: https://github.com/RealCLanger/OpenJDKEclipseProjects > > The main benefit of these Eclipse projects is that the projects for all modules and tests are linked together so you will immediately recognize errors in dependencies. I think that doesn't work so well with IntelliJ. > > Another hint: There's a mailing list called ide-support-dev where questions around IDE support can get discussed. > > Best regards > Christoph > >> -----Original Message----- >> From: discuss On Behalf Of Clemens >> Eisserer >> Sent: Freitag, 15. Januar 2021 21:33 >> To: discuss at openjdk.java.net >> Subject: recommended IDE for developing openjdk? >> >> Hi, >> >> About 10 years ago I used eclipse to work on OpenJDK, however I would like >> to get rid of it because of its slow/ugly user interface. >> I wonder, are there any recommendations which IDE to use these days? >> I gave IntelliJ a try but having not used it that much (except for some >> fairly standard maven based projects) I failed to configure it correctly, >> however I haven't tried Netbeans still. >> >> So to make it short: Which IDE is known to cope well with working on the >> OpenJDK codebase? >> And are there detailed instructions available for creating an openjdk >> project with intellij? >> Or would I be better off using netbeans? >> >> Thank, Clemens From jan.lahoda at oracle.com Mon Jan 18 13:42:48 2021 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Mon, 18 Jan 2021 14:42:48 +0100 Subject: recommended IDE for developing openjdk? In-Reply-To: References: Message-ID: Hi, For recent Apache NetBeans (12.2): Opening the (Java) modules of the OpenJDK: -have the OpenJDK configured, ideally with `--with-jtreg` (not mandatory, but better), and built (not mandatory, but better) -run NetBeans, ideally on a JDK 15 -(a bug workaround, this only needs to be done once, sorry for that): activate Java: in the main menu, do File/New Project, select any Java project, click next, and on a panel saying Java SE needs to be activated, press Activate, and when that is done, cancel the wizard -then the Java modules of OpenJDK can be opened as project, do File/Open Project and select e.g. src/java.base, src/jdk.compiler, src/jdk.jshell, ... -tests under "test/jdk" will be available in under the java.base module/project, tests under test/langtools will be available under the java.compiler project There is a certain level of settings under Project Properties of the projects, like location of jtreg, if it is not specified during configuration. There is also a limited support for the C/C++ sources, based on ccls and/or clangd. Jan On 18. 01. 21 12:11, Maurizio Cimadamore wrote: > Hi, > thanks for the pointer to the Eclipse project - I'm sure folks will find > that useful. > > I think these days the IntelliJ support is relatively polished - there > are features missing yes (for instance the project is monolitic, and not > modularized, but folks here are using it pretty regularly and I can't > say that has been a huge issue so far). > > To get started with intellij you have to create an IDE configuration first. > > 1. first run `sh configure` as you normally would to set up your JDK > build - that build configuration would then be reused by Intellij > > 2. then run `sh bin/idea.sh - e.g. `sh > bin/idea.sh java.base jdk.compiler java.desktop` - this will create an > `.idea` folder in the current directory and set the sources for the JDK > modules you specified. > > 3. open IntelliJ and point it to the folder where the `.idea` folder has > been created. If everything worked correctly you should have a project > up and running. > > The base project supports actions for cleaning, rebuilding the selected > modules, or building a JDK image. > > Optionally, you can also build and install a jtreg plugin, to run and > debug tests: > > https://openjdk.java.net/jtreg/intellij-plugin.html > > > I use this setup on a daily basis and I think it works pretty well - > there are things that can be improved (for instance, I don't think the > generated sources are always recognized correctly, we need to look into > that), but I'm quite productive with it (especially with the jtreg > plugin enabled). > > I know that there is also some limited support for VSCode (especially > for hotspot development): > > https://github.com/openjdk/jdk/blob/master/doc/ide.md > > And that there is Netbeans support as well - CC'ing Jan who knows more > than I do on how to get started there. > > Eventually we should collect all this info in a single place, but I > never found the time to do so. Apologies! > > Cheers > Maurizio > > > On 18/01/2021 09:46, Langer, Christoph wrote: >> Hi Clemens, >> >> while I won't argue about the fanciness of the Eclipse user interface >> (??), I'd like to point you to a set of Eclipse projects that I >> created nevertheless... >> >> You'll find them here: >> https://github.com/RealCLanger/OpenJDKEclipseProjects >> >> The main benefit of these Eclipse projects is that the projects for >> all modules and tests are linked together so you will immediately >> recognize errors in dependencies. I think that doesn't work so well >> with IntelliJ. >> >> Another hint: There's a mailing list called ide-support-dev where >> questions around IDE support can get discussed. >> >> Best regards >> Christoph >> >>> -----Original Message----- >>> From: discuss On Behalf Of Clemens >>> Eisserer >>> Sent: Freitag, 15. Januar 2021 21:33 >>> To: discuss at openjdk.java.net >>> Subject: recommended IDE for developing openjdk? >>> >>> Hi, >>> >>> About 10 years ago I used eclipse to work on OpenJDK, however I would >>> like >>> to get rid of it because of its slow/ugly user interface. >>> I wonder, are there any recommendations which IDE to use these days? >>> I gave IntelliJ a try but having not used it that much (except for some >>> fairly standard maven based projects) I failed to configure it >>> correctly, >>> however I haven't tried Netbeans still. >>> >>> So to make it short: Which IDE is known to cope well with working on the >>> OpenJDK codebase? >>> And are there detailed instructions available for creating an openjdk >>> project with intellij? >>> Or would I be better off using netbeans? >>> >>> Thank, Clemens From maurizio.cimadamore at oracle.com Mon Jan 18 15:02:57 2021 From: maurizio.cimadamore at oracle.com (Maurizio Cimadamore) Date: Mon, 18 Jan 2021 15:02:57 +0000 Subject: recommended IDE for developing openjdk? In-Reply-To: References: Message-ID: <6d60d3e9-6c23-3a33-7905-b5fad3766370@oracle.com> 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 > > -Pavel > >> On 18 Jan 2021, at 11:11, Maurizio Cimadamore wrote: >> >> Hi, >> thanks for the pointer to the Eclipse project - I'm sure folks will find that useful. >> >> I think these days the IntelliJ support is relatively polished - there are features missing yes (for instance the project is monolitic, and not modularized, but folks here are using it pretty regularly and I can't say that has been a huge issue so far). >> >> To get started with intellij you have to create an IDE configuration first. >> >> 1. first run `sh configure` as you normally would to set up your JDK build - that build configuration would then be reused by Intellij >> >> 2. then run `sh bin/idea.sh - e.g. `sh bin/idea.sh java.base jdk.compiler java.desktop` - this will create an `.idea` folder in the current directory and set the sources for the JDK modules you specified. >> >> 3. open IntelliJ and point it to the folder where the `.idea` folder has been created. If everything worked correctly you should have a project up and running. >> >> The base project supports actions for cleaning, rebuilding the selected modules, or building a JDK image. >> >> Optionally, you can also build and install a jtreg plugin, to run and debug tests: >> >> https://openjdk.java.net/jtreg/intellij-plugin.html >> >> >> I use this setup on a daily basis and I think it works pretty well - there are things that can be improved (for instance, I don't think the generated sources are always recognized correctly, we need to look into that), but I'm quite productive with it (especially with the jtreg plugin enabled). >> >> I know that there is also some limited support for VSCode (especially for hotspot development): >> >> https://github.com/openjdk/jdk/blob/master/doc/ide.md >> >> And that there is Netbeans support as well - CC'ing Jan who knows more than I do on how to get started there. >> >> Eventually we should collect all this info in a single place, but I never found the time to do so. Apologies! >> >> Cheers >> Maurizio >> >> >> On 18/01/2021 09:46, Langer, Christoph wrote: >>> Hi Clemens, >>> >>> while I won't argue about the fanciness of the Eclipse user interface (??), I'd like to point you to a set of Eclipse projects that I created nevertheless... >>> >>> You'll find them here: https://github.com/RealCLanger/OpenJDKEclipseProjects >>> >>> The main benefit of these Eclipse projects is that the projects for all modules and tests are linked together so you will immediately recognize errors in dependencies. I think that doesn't work so well with IntelliJ. >>> >>> Another hint: There's a mailing list called ide-support-dev where questions around IDE support can get discussed. >>> >>> Best regards >>> Christoph >>> >>>> -----Original Message----- >>>> From: discuss On Behalf Of Clemens >>>> Eisserer >>>> Sent: Freitag, 15. Januar 2021 21:33 >>>> To: discuss at openjdk.java.net >>>> Subject: recommended IDE for developing openjdk? >>>> >>>> Hi, >>>> >>>> About 10 years ago I used eclipse to work on OpenJDK, however I would like >>>> to get rid of it because of its slow/ugly user interface. >>>> I wonder, are there any recommendations which IDE to use these days? >>>> I gave IntelliJ a try but having not used it that much (except for some >>>> fairly standard maven based projects) I failed to configure it correctly, >>>> however I haven't tried Netbeans still. >>>> >>>> So to make it short: Which IDE is known to cope well with working on the >>>> OpenJDK codebase? >>>> And are there detailed instructions available for creating an openjdk >>>> project with intellij? >>>> Or would I be better off using netbeans? >>>> >>>> Thank, Clemens From pavel.rappo at oracle.com Tue Jan 19 17:33:52 2021 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Tue, 19 Jan 2021 17:33:52 +0000 Subject: recommended IDE for developing openjdk? Message-ID: <065BA92F-790F-4659-85A1-2C42BB8B7D63@oracle.com> 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 From maurizio.cimadamore at oracle.com Wed Jan 20 12:26:26 2021 From: maurizio.cimadamore at oracle.com (Maurizio Cimadamore) Date: Wed, 20 Jan 2021 12:26:26 +0000 Subject: recommended IDE for developing openjdk? In-Reply-To: <065BA92F-790F-4659-85A1-2C42BB8B7D63@oracle.com> References: <065BA92F-790F-4659-85A1-2C42BB8B7D63@oracle.com> Message-ID: 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 Sent: Tuesday, January 19, 2021 5:33 PM To: Maurizio Cimadamore Cc: Langer, Christoph ; Clemens Eisserer ; discuss at openjdk.java.net ; ide-support-dev at openjdk.java.net ; Jan Lahoda 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 From maurizio.cimadamore at oracle.com Wed Jan 20 12:56:57 2021 From: maurizio.cimadamore at oracle.com (Maurizio Cimadamore) Date: Wed, 20 Jan 2021 12:56:57 +0000 Subject: recommended IDE for developing openjdk? In-Reply-To: <065BA92F-790F-4659-85A1-2C42BB8B7D63@oracle.com> References: <065BA92F-790F-4659-85A1-2C42BB8B7D63@oracle.com> Message-ID: <00163591-6131-e745-aaf1-85ced7d63f96@oracle.com> Resending with right formatting, sorry On 19/01/2021 17:33, Pavel Rappo wrote: > 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.) 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'm not sure how this tweak affects indexing though. 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 > > -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 From pavel.rappo at oracle.com Wed Jan 20 18:41:18 2021 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Wed, 20 Jan 2021 18:41:18 +0000 Subject: recommended IDE for developing openjdk? In-Reply-To: <00163591-6131-e745-aaf1-85ced7d63f96@oracle.com> References: <065BA92F-790F-4659-85A1-2C42BB8B7D63@oracle.com> <00163591-6131-e745-aaf1-85ced7d63f96@oracle.com> Message-ID: Maurizio, Replies are inline. > On 20 Jan 2021, at 12:56, Maurizio Cimadamore wrote: > > Resending with right formatting, sorry > > On 19/01/2021 17:33, Pavel Rappo wrote: >> 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.) > > 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? This is my impression too. Here's my speculation: there seems to be implicit and explicit exclusion. While "explicit exclusion" implies "implicit exclusion", "implicit exclusion" does not imply "explicit exclusion". Unfortunately, reading this article didn't clarify the exclusion mechanism for me: https://www.jetbrains.com/help/idea/indexing.html >> >> 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. > > 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... Interesting; I have a few questions on that. 1. What version of IntelliJ IDEA did you try that in? 2. Did you build the project before executing `sh ./bin/idea.sh <...> java.base <...>`? 3. Could you see the "build/<...>/support/gensrc/java.base [generated]" entry in the "Source Folders" list above the "Excluded Folders" list? 4. Did you allow the IDE to complete the incremental indexing after pressing "Apply"? -Pavel From maurizio.cimadamore at oracle.com Wed Jan 20 18:45:40 2021 From: maurizio.cimadamore at oracle.com (Maurizio Cimadamore) Date: Wed, 20 Jan 2021 18:45:40 +0000 Subject: recommended IDE for developing openjdk? In-Reply-To: References: <065BA92F-790F-4659-85A1-2C42BB8B7D63@oracle.com> <00163591-6131-e745-aaf1-85ced7d63f96@oracle.com> Message-ID: > Interesting; I have a few questions on that. > > 1. What version of IntelliJ IDEA did you try that in? Latest (2020.3.1) > 2. Did you build the project before executing `sh ./bin/idea.sh <...> java.base <...>`? Yes > 3. Could you see the "build/<...>/support/gensrc/java.base [generated]" entry in the "Source Folders" list above the "Excluded Folders" list? Yes > 4. Did you allow the IDE to complete the incremental indexing after pressing "Apply"? Yes Maurizio > > -Pavel >