IntelliJ & JDK 9

Martijn Verburg martijnverburg at gmail.com
Mon Dec 22 12:16:27 UTC 2014


Hi Will/All,

That's great work - thanks so much!  I suggest that you repost the
outstanding questions to the build-dev group, they can hopefully help with
some (although as Ivan points out, not all) of these issues.

Overall it would be a great help to adoption if some of this IDE support
went back into OpenJDK proper.



Cheers,
Martijn

On 22 December 2014 at 09:36, Ivan St. Ivanov <ivan.st.ivanov at gmail.com>
wrote:

> Hi Will,
>
> Great job!
>
> We in the Bulgarian Java User Group have spent some time in this direction
> as well. You can find a virtual machine with IntelliJ IDEA with the
> projects imported on this address:
>
> ftp://bgjug.sty-consulting.com/openjdk-fedora/openjdk-fedora.ova
>
> Our BG JUG fellow Mihail Stoynov is working right now on providing a module
> structure that anyone can directly import in IDEA and start working with
> OpenJDK. You just need to set a few variables before that.
>
> I couldn't find a way to remove the default jdk module (your step number
> 7), but still with proper module ordering jdk 8 will be ignored. Once we
> have no-rt.jar support in IDEA we'll be able to use the jdk image that we
> build from the sources.
>
> To answer your open questions:
> - The tests in OpenJDK do not follow a standard setup from a today's
> project point of view. You cannot simply import them as a whole in the IDE.
> If you insist and have the patience, then I would say that each directory
> under jdk/test is a separate test root folder. That is why we decided not
> to import them and use tools like gedit to edit the tests. If you want to
> run a particular test, then we found that you should use the run external
> process functionality and spawn jtreg
> - The build system of OpenJDK is make, so we again ignored the compiler
> output directories altogether
> - This picture
> <https://bugs.openjdk.java.net/secure/attachment/21573/jdk-tr.png> is very
> useful about the inter-module dependencies. We used that to model the
> dependencies when we set up our IntelliJ IDEA project. The JEP-200
> <http://openjdk.java.net/jeps/200> definition contains very good
> explanation on what the different edges and vertices in this graph mean
>
> Cheers,
> Ivan
>
>
>
>
> On Mon, Dec 22, 2014 at 1:22 AM, Will May <will.j.may at gmail.com> wrote:
>
> > Hi all,
> >
> > I've just written a simple script which will generate a project structure
> > that can be imported into IntelliJ for JDK9. I've created a PR on github
> > against the BuildHelpers repository for the initial version of the script
> > but there are possibly issues with this script:
> >
> >
> >    - Test directory appears to be a bunch of random test classes in
> random
> >    directories and not packages; I'm not sure how thisb should be seen
> > within
> >    an IDE.
> >    - Modules have been configured to have their compiler output to
> >    build/linux-x86_64-normal-server-release/jdk/modules although I'm not
> > sure
> >    how well IntelliJ and the JDK build system play together.
> >    - No inter-module dependencies. Is there any documentation about these
> >    dependencies anywhere?
> >
> > To use the script with IntelliJ:
> >
> >    1. Create a new project
> >    2. Select Java, set the project SDK to Java 8 and click next
> >    3. Click next (don't create from template)
> >    4. Change the project location to jdk9/jdk and click finish
> >    5. Once in IntelliJ, open up the project structure settings (File >
> >    Project Structure)
> >    6. Change the language level to Java 9
> >    7. In modules section, remove the default jdk module (answer yes to
> the
> >    popup). Delete the jdk.iml file.
> >    8. Run the script now.
> >    9. Select all iml files in the project structure, right click and
> select
> >    'Import 47 modules'
> >
> > Is there any other functionality that is missing from this script? Can
> > someone give my account on the wiki sufficient privileges to document
> this
> > script and also accept my PR on github?
> >
> > Cheers,
> >
> >
> > Will.
> >
>


More information about the adoption-discuss mailing list