Intellij project with idea.sh

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue Jun 29 20:32:25 UTC 2021


On 29/06/2021 20:15, Sergei Ustimenko wrote:
> Hi Maurizio,
>
> Thanks for the quick reply!
> Thanks, now I see that excluding the classes and no SDK in the beginning are by design.
>
> It seems that I've solved the problem: I do use the latest built version of the SDK i.e. 18
> (as well as openjdk-16), the problem in my case with modules was that I had to set the
> language level to (in my case) "16 Sealed Types" or to "X - experimental features".
> It was (I think) malformed, so when I switched it to "16" and then to "X" then it worked.
Yeah - that sometimes creates issues as well, I had not time to 
investigate why exactly.
> With a small note that in .idea/misc.xml it is still:
> <component name="ProjectRootManager" ... languageLevel="JDK_16_PREVIEW" ... project-jdk-name="18-ea" project-jdk-type="JavaSDK">
> ...
> </component>
> Though, problems with modules are not visible now - hope it helps others.
We could try to fix the template to point at "X level" - perhaps that 
might work, yes.
>
> I've seen there is a documentation placeholder for IDE support for Java code in doc/ide.md. Is it
> something that we could update to reflect steps for Intellij for Java, what do you think?

ide.md is a good place where to put documentation regarding IDE support 
(AFAIK, right now it mostly documents steps on how to work with JVM code).

Maurizio

>
> Cheers,
> Sergei
>
> Sent with ProtonMail Secure Email.
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>
> On Tuesday, June 29th, 2021 at 18:13, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote:
>
>> Hi,
>>
>> thanks for trying the script and report back! Some comments inline:
>>
>> On 29/06/2021 16:51, Sergei Ustimenko wrote:
>>
>>> Hi,
>>>
>>> I had a small, perhaps even dummy, question about idea.sh and current version of Intellij and how
>>>
>>> to configure it for the core-libs source tree.
>>>
>>> It is very nice that there is a script to generate an idea project - it really saves a lot of time.
>>>
>>> I followed instructions https://mail.openjdk.java.net/pipermail/ide-support-dev/2021-January/000059.html
>>>
>>> from Maurizio, though when I generate the project, I get following:
>>>
>>> -   all the classes in all modules are excluded from compilation (not sure if this is intended or not;
>>>
>>>      all the classes' and source folders' icons in the project view have a tiny cross in the left upper corner).
>> This is intended - otherwise IntelliJ would try to build these classes
>>
>> itself (w/o using make - which won't work)
>>
>>> -   sdk is missing (but I, of course, can add it very easily - the one from the build/ folder)
>> That's also intended - I have not find a way to set up a project-wide
>>
>> SDK which can be configured from command line. SDKs are a global setting
>>
>> in IntelliJ.
>>
>>> -   there are classes in core-libs that don't have access to certain packages from other modules
>>>
>>>      e.g. jdk.internal.net.http.HttpRequestBuilderImpl can't access HttpHeadersBuilder because of
>>>
>>>      the following problem: "Package 'jdk.internal.net.http.common' is declared in module
>>>
>>>      'java.net.http', which does not export it to the unnamed module". Ide highlights all such occurrences
>>>
>>>      red although it indexes them and I can jump to them. I can add it these modules manually but I don't
>>>
>>>      think it the best way to move forward.
>> Uhmmm - I can't seem to be able to reproduce this one, but occasionally
>>
>> I did witness something similar. Have you tried updating your SDK to
>>
>> something more recent?  E.g is it possible that the SDK you are using is
>>
>> old-ish (e.g. Java 16 or something?)
>>
>> Thanks
>>
>> Maurizio
>>
>>> I am not sure if I'm missing anything or doing something wrong but could you please guide me
>>>
>>> a bit or point in the right direction how can I set up Intellij Idea to work with core-libs properly.
>>>
>>> I don't really want my setup to backfire.
>>>
>>> I use Intellij Idea 2021.1.2, ant-1.10.10 to run idea.sh and openjdk build with make works fine for me.
>>>
>>> Thanks,
>>>
>>> Sergei


More information about the ide-support-dev mailing list