Query on developing OpenJDK with IntelliJ

Jonathan Bluett-Duncan jbluettduncan at gmail.com
Tue Sep 13 00:09:34 UTC 2016


Hi Staffan and Maurizio,

Thanks for the pointers! The script which the email thread refers to
(jdk9/common/bin/idea.sh) helped me get rid of those useless red squiggles.
:)

However, I now have a new problem, where not just the useless red squiggles
but also the useful ones are gone as well; they don't even show up when I
write syntactically invalid code like "System.out.pr".

Additionally, whereas before my editor performed code analysis and
highlighting on-the-fly e.g. pointing out unused imports, it now doesn't
seem to do so anymore.

I've read http://stackoverflow.com/a/30810965/2252930 and tried
closing/reopening IntelliJ and invalidating the caches, but they both don't
seem to solve my problem.

I've found I can run Analyze -> Inspect Code...  to do manual code
analysis, but it doesn't solve my problem of completely lacking any useful
error indicators.

Is this a recognised limitation of the common/bin/idea.sh solution?

Kind regards,
Jonathan

On 12 September 2016 at 21:46, Maurizio Cimadamore <
maurizio.cimadamore at oracle.com> wrote:

> I confirm that the use case you bring up is addressed with the available
> IntelliJ project configuration. I've tried creating a project for the
> modules java.base and jdk.jshell, and then opened the class
> jdk.jshell.TaskFactory, which mention the Version class, which is new in
> JDK 9. No red lines, and I could jump to definition as usual.
>
> Maurizio
>
>
>
> On 12/09/16 09:23, Staffan Larsen wrote:
>
>> See if this email thread helps you out:
>>
>> http://mail.openjdk.java.net/pipermail/jdk9-dev/2016-April/004136.html
>> http://mail.openjdk.java.net/pipermail/jdk9-dev/2016-May/004173.html
>>
>> /Staffan
>>
>> On 10 sep. 2016, at 17:11, Jonathan Bluett-Duncan <
>>> jbluettduncan at gmail.com> wrote:
>>>
>>> Hi all,
>>>
>>> I have a question regarding setting up a particular aspect of my
>>> development environment for OpenJDK, and I wonder if this is the right
>>> mailing list for me to post such questions.
>>>
>>> When I open my local clone of the JDK 9 codebase as a project in IntelliJ
>>> Ultimate 2016.2, there are a number of places where IntelliJ gets
>>> confused
>>> and shows red squiggles underneath lines of code that exist in JDK 9 but
>>> not JDK 8. I think this is happening for a couple of reasons.
>>>
>>>    1. My IntelliJ project is currently setup to use my machine's
>>> installed
>>>    JDK 8 distribution as it's Java SDK (as it should be, to the best of
>>> my
>>>    knowledge).
>>>    2. When my IntelliJ encounters java.* classes, it refers to the java.*
>>>    classes in my installed JDK 8 rather than those in my JDK 9 project.
>>>
>>> I want to "tell" IntelliJ to use the JDK 9 java.* classes in my project,
>>> rather than those in my installed JDK 8, so that these red squiggles are
>>> eliminated, and I wonder if anyone here has come across a solution for
>>> doing so.
>>>
>>> If my query is not appropriate for this list, would you kindly let me
>>> know
>>> which list I should contact instead?
>>>
>>> Kind regards,
>>> Jonathan
>>>
>>
>



More information about the build-dev mailing list