4

I'm installing SonarQube v5.0.

I'm running Windows Server 2012 64-bit (a virtual OS), Java 1.8 64-bit, and the SonarQube windows-x86-64 wrapper.

SonarQube, whether run via StartSonar.bat using Command Prompt as Administrator or as a Windows Service, keeps throwing the following warning:

WARNING - Unable to load the Wrapper's native library 'wrapper.dll'.
      The file is located on the path at the following location but
      could not be loaded:
        C:\sonarqube-5.0.1\bin\windows-x86-64\.\lib\wrapper.dll
      Please verify that the file is readable by the current user
      and that the file has not been corrupted in any way.
      One common cause of this problem is running a 32-bit version
      of the Wrapper with a 64-bit version of Java, or vica versa.
      This is a 32-bit JVM.
      Reported cause:
        C:\sonarqube-5.0.1\bin\windows-x86-64\lib\wrapper.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
      System signals will not be handled correctly.

The only info that I've found on the web is some JIRA's from 2010 that don't really help me. I can't create a sonar user on this Windows installation. All my other tools in my CI environment are running on Java 1.8 64-bit, which means that JAVA_HOME is set to JDK 1.8 64-bit. I really don't want to have to run Java 32-bit and the 32-bit Wrapper. That means that the JRE bin/java path at the top of wrapper.conf will have to specify the 32-bit JRE.

What can I do to get rid of this warning?

Chris Harris
  • 1,329
  • 4
  • 17
  • 28

5 Answers5

7

Not all applications use JAVA_HOME variable, so you can have JAVA_HOME pointing on your 64 bits version while you are using a 32 bits. Note: the 'Java_Home' key in the registry is not the JAVA_HOME variable.

Well, one way to be sure is to uninstall the current service, with ..\windows-x86-64\UninstallNTService.bat and install the 32 bits version with ..\windows-x86-32\InstallNTService.bat.

If it works, you definitively have a 32 bits JVM.

Qualilogy
  • 789
  • 5
  • 6
  • I found JavaHome in the registry in several places. In one particular section of the registry, HKEY_LOCAL_MACHINE -> SOFTWARE -> Wow6432Node -> JavaSoft, I found some JavaHome keys pointing to the path of a 32-bit Java 1.8. I didn't explicitly install that JVM, but I suspect that installing Java for Firefox did, since that browser is 32-bit. – Chris Harris Mar 16 '15 at 20:50
  • I tried your advice and was able to install the 32-bit service. However, I ran into another issue that I've posted on SO (can't write to a Temp) folder). So, I uninstalled the 32-bit wrapper, uninstalled the 32-bit JRE, and installed the SonarQube 64-bit wrapper. That solved both the .dll error message and the Temp folder error message. Thanks! – Chris Harris Mar 16 '15 at 20:53
  • Dont forget to add %JAVA_HOME%/bin as very first path element in Windows PATH variable. That will turn off any offending 32 bit paths on sonar startup. – maggu Apr 07 '15 at 09:14
0

Installed the service SonarQube in \sonarqube-5.1.2\bin\windows-x86-64.

I just went to the SonarQube in the Windows Services-->go to properties-->Log On tab--->select 'Local Service'(Entered the system password). Thats it!

Issue was resolved.

Hope this helps someone who was not able to resolve from the above posts.

WonderHeart
  • 678
  • 10
  • 28
0

I experienced the same problem with SonarQube 5.6.4 on Windows 7. Editing the sonar.properties file to add a wrapper.java.command=... had no effect. Editing my path statement did the trick, though.

The first two folders in my path statement had been

C:\ProgramData\Oracle\Java\javapath;C:\dev\sdks\jdk1.8.0_112\bin;....

The java.exe in the first (C:\ProgramData\Oracle\Java\javapath) is 32-bit. I just switched the two in my path:

C:\dev\sdks\jdk1.8.0_112\bin;C:\ProgramData\Oracle\Java\javapath;...

Suddenly SonarQube started using the 64-bit java.exe in C:\dev\sdks\jdk1.8.0_112\bin

After making this change, I was able to restart Firefox without any difficulty.

ChrisFal
  • 181
  • 6
0

In my case, running on SonarQube 7.3 on window 7 or window 10, I have to update Java version to java 8 to pass this error.

alex
  • 1
0

No need for this, In my case I just Installed Java SE JDK 11.0.16 and installed it, and restarted the sonar server and it worked. Below is the URL to download

https://www.techspot.com/downloads/5553-java-jdk.html