How to configure Open JDK 11 in STS?

6.7k views Asked by At

How to configure Open JDK-11 in STS(3.5)? When i go to window > Preferences > Java > Installed JRE's and provide OPENJDKHomeFolder\bin, i get a message "Target is not a JDK root. javaexecutable not found".

I could not find any references/documentation to this problem. Any suggestions please.

2

There are 2 answers

1
Pradeep On BEST ANSWER

Apologies. I used sts-4.8.0.RELEASE. @MartinLippert - I had to do the below as well to make it work - In sts-4.8.0.RELEASE\SpringToolSuite4.ini file, i had to add the below in the very first line in addition to pointing to home folder as mentioned by @Kris -vm
OpenJDK11\openjdk-11.0.2_windows-x64_bin\jdk-11.0.2\bin\javaw.exe (absolute path)

Note: Adding the above anywhere else in ini file will not work. Why? Note sure!

Ironical that, i could not find any refences to this problem. Had to spent 1 day to figure out this. Anyways got it working and hope it will be useful for others.

0
Kris On

Basically, I think are doing it almost correctly. Instead of pointing to the 'bin' folder instead point it to the 'root' folder of the JVM installation, as the message suggests.

So in other words do not point at the 'bin' folder but at the parent of that folder.