The dreadful missing JDK dialog on macOS

I’m not a fan of Eclipse or products derived from Eclipse. I think they’re slow, not very intuitive and the program state never seems to be up to date, but sometimes unfortunately there’s no alternative.

Sometimes I use Apache Directory Studio to edit my LDAP data. Today I installed Directory studio, but it wouldn’t start because it couldn’t find the JDK. I have unwrapped several JDK tar balls in my /opt directory, but Directory Studio doesn’t know that.

Of course I immediately started googling and a lot of people mentioned to put -vm <path to java> in the Contents/Eclipse/ApacheDirectoryStudio.ini inside the application’s folder in /Applications. This unfortunately didn’t work for me.

I started checking other files in the application folder and found Contents/Info.plist. Inside the array tag in that file at the bottom there’s a comment about using a particular Java version. Adding this to that array tag did the trick: <string>-vm</string><string>/somepath/java</string>

Just now I have installed Eclipse to see if it suffers from the same problem out of the box and it does. The solution is the same for Eclipse. Just add the vm information in the Info.plist in the Contents folder in the Eclipse application folder.