updating the java jdk path in intellij idea on macos

I have a very short fuse when it comes to wading through bad advice found on the web, especially old technical advice. Case in point, how to update a current release of IntelliJ IDEA’s Java/JDK path to an external JDK already installed on your machine.

I’m currently trying to do some work with:

  • Java/OpenJDK 11.0.5 LTS release distributed by AdoptOpenJDK using
  • IntelliJ IDEA Community Edition 2019.2 on
  • macOS Mojave 10.14.6.

When I started to try and use that Java release, IntelliJ couldn’t seem to find it, and I couldn’t seem to configure IntelliJ where to look. After looking at six-year-old directions via the web that were mostly right I finally figured it out. Here’s what to do with the latest release of IntelliJ.

Open the File menu and select Project Structure. This used to be buried in Other Settings, which is where all those older directions tell you to go. Now it’s out in the open, probably because of the shift from Java8 to Java9 and beyond that’s been occurring every six months since Java9 was released Setember 2018.

A dialog will show up as shown below.

In my example I’ve already set up to use Java 11.0.5. To add a new location, click the red folder on the far right, where you see the help balloon in the screen capture above. Clicking that will open a regular folder/file dialog allowing you to pick he location where your specific Java release is located on your Mac. Once you’ve set up the correct location click OK and go back to editing in the IntelliJ IDE.

I hate searching for technical information on the web, because it is without exception for older (many times far older) software than what you’re currently working with. The majority of it is old crap from Stack Overflow. And as far as I can tell, none of the search engines are capable of bubbling up current information, let alone correct information. I mean, you should have seen what I also got looking for the answer to this question.

You’re welcome.

netbeans 10

NetBeans 10.0 is the second release through Apache, the first being NetBeans 9. The group responsible for moving NetBeans out of Oracle’s shadow and into a position where NetBeans stands on its own has been hard at work. This second release adds new features as well as continuing the work of removing/replacing the older Oracle licensing and any non-open-source code that needs to be replaced. A complete “What’s New” page is here, and you can download NetBeans 10 here, but the key new features for the impatient are support for Java 11, support for PHP 7.2, and inclusion of JUnit 5.

At the same time I stepped up to NetBeans 10 I rolled back to Java 8. Because I use JavaFX in many of my personal applications, when I tried to move forward into Oracle’s Java 11, the JavaFX libraries were of course gone from Java. Trying to add them back in via OpenJFX became such a problem that I made the decision to revert all my changes and go back to Java 8. Unfortunately, Oracle’s Java 8 open support ends January 1 2019, and I’ve never a decent version of OpenJava work for me (at least on Linux), so I went looking for an alternative to Oracle and found Amazon’s Corretto Release.

I have moved back to Java 8 build 192 using Amazon’s Corretto Java. Amazon’s Corretto is their version of OpenJDK, which they are building and hardening for AWS usage. Amazon has stated that they will support their version of Java 8 until 2023. They plan on releasing their version of OpenJDK 11 (Java 11) sometime in February. When that takes place I’ll try this movement into Java 11 again. But until then I’m back to using Java 8. The way things are going with Java I may never move beyond Java 8. I’m already quite happy with Google Go, and with Go 1.11.4 I’ve begun to go in interesting directions, such as generating Web Assembly directly from Go and having it execute in a web page. I now spend far more time writing in Go than in Java. I wonder what will happen in 2019…

For those of you who develop in Java on macOS and want to use NetBeans 10 as a regular macOS applications (i.e. startable via LaunchPad), I’ve written a modest Bash shell script that will take the NetBeans zip file and create a compliant Mac application from it underneath ~/Applications. It’s checked into Github here.¬†You use it just once to install the zip. I used it to install NetBeans 10. Because NetBeans 10 is installed into ~/Applications you don’t have to execute the Bash script as root via sudo.