How to install SonarQube with Open JDK 11

2.7k Views Asked by At

I am trying to install SonarQube 8.5 (community version) on my local machine . My machine already has Java JRE 8 installed. SonaQube has pre-requirement JRE 11 or Open JDK 11. Since you cannot download JRE 11 anymore, I decided to go with Open JDK 11

I want to set SonarQube to use specific JDK. How do i do that?

Quick SO search suggest to use wrapper.java.command in wrapper.conf file, but this line is not available

SonarQube 8.5, OS Windows: 10

enter image description here

3

There are 3 best solutions below

0
Sourav On

If you want your sonarqube to use specific JDK i.e. in your case OpenJDK 11, rather than use JRE 8. You can create a user say sonar.

Give sonar user the ownership of all the installations of sonarqube. Set the path of JAVA_HOME for OpenJDK11 for the usersonar only.

Note: You have to start sonarqube using sonar user only.

Then , you can set SonarQube to use specific JDK

1
LP13 On

actually i found it These doesn't exist by default, so I need to add these two lines into wrapper.conf

wrapper.java.command=C:\SonarQube\openjdk-11.0.2-win64\jdk-11.0.2\bin
wrapper.java.command=C:\SonarQube\openjdk-11.0.2-win64\jdk-11.0.2\bin\Java

Your installation base path may be different. But bin and bin\Java is important

0
Djordje Nedovic On

According to sonarqube community, you should do the following:

  1. Edit conf\wrapper.conf, specifically the wrapper.java.command to following:

wrapper.java.command=C:\Program Files\Java\open jdk-11.0.2\bin\java #wrapper.java.command=java