Intellij project with idea.sh

Jonathan Gibbons jonathan.gibbons at oracle.com
Wed Jun 30 15:42:03 UTC 2021


I believe most of LangTools is subject to the JDK_X - 1 requirement.  It 
shows up in the makefiles via the `INTERIM_*` variables.

-- Jon

On 6/30/21 3:30 AM, Maurizio Cimadamore wrote:
> This looks good to me. For langtools, we ideally like JDK_X minus one 
> :-) - but that's impossible to do. Also there are parts of langtools 
> such as jshell, javadoc, javap which are allowed to use latest 
> features. The problem is really only javac, but javac developers know 
> well to stay clear of shiny new language features anyway :-)
>
> Thanks
> Maurizio
>
> On 30/06/2021 09:30, Sergei Ustimenko wrote:
>> Hi Maurizio,
>>
>> I've prepared a tiny patch to address the language level issue in the 
>> misc.xml
>> and wanted to know your opinion before submitting any PR. There are 
>> two xmls that
>> I've updated: one in /make/ide/idea/jdk/template/ and another in
>> /make/ide/idea/langtools/template/. If the second one is not needed 
>> (I haven't found
>> any references to it) I can remove it from the patch.
>>
>> Happy to hear your feedback.
>>
>> Thanks,
>> Sergei
>>
>> The patch is inlined:
>>
>> diff --git a/make/ide/idea/jdk/template/misc.xml 
>> b/make/ide/idea/jdk/template/misc.xml
>> index 669c382327a..48600125348 100644
>> --- a/make/ide/idea/jdk/template/misc.xml
>> +++ b/make/ide/idea/jdk/template/misc.xml
>> @@ -12,7 +12,7 @@
>>         <target 
>> file="file://###ROOT_DIR###/make/ide/idea/jdk/build.xml" 
>> name="images" />
>>       </ant>
>>     </component>
>> -  <component name="ProjectRootManager" version="2" 
>> languageLevel="JDK_16" assert-keyword="true" jdk-15="true">
>> +  <component name="ProjectRootManager" version="2" 
>> languageLevel="JDK_X" assert-keyword="true" project-jdk-type="JavaSDK">
>>       <output url="file://###BUILD_DIR###/idea" />
>>     </component>
>>   </project>
>> diff --git a/make/ide/idea/langtools/template/misc.xml 
>> b/make/ide/idea/langtools/template/misc.xml
>> index c2121cda146..dca7ff8abe7 100644
>> --- a/make/ide/idea/langtools/template/misc.xml
>> +++ b/make/ide/idea/langtools/template/misc.xml
>> @@ -12,7 +12,7 @@
>>         <target 
>> file="file://$PROJECT_DIR$/make/ide/idea/langtools/build.xml" 
>> name="build-all-classes" />
>>       </ant>
>>     </component>
>> -  <component name="ProjectRootManager" version="2" 
>> languageLevel="JDK_1_8" assert-keyword="true" jdk-15="true" 
>> project-jdk-name="1.8" project-jdk-type="JavaSDK">
>> +  <component name="ProjectRootManager" version="2" 
>> languageLevel="JDK_X" assert-keyword="true" project-jdk-type="JavaSDK">
>>       <output url="file://$PROJECT_DIR$/build" />
>>     </component>
>>   </project>
>>
>>
>>
>> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>>
>> On Tuesday, June 29th, 2021 at 22:32, Maurizio Cimadamore 
>> <maurizio.cimadamore at oracle.com> wrote:
>>
>>> 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
>>>


More information about the ide-support-dev mailing list