OpenJDK 64-Bit Server VM is an unsupported JVM
Symptoms
The Bitbucket Server UI shows the following error when trying to access http://BITBUCKET_HOST:PORT
:
The following problem occurred which prevents Atlassian Bitbucket Server from starting correctly
OpenJDK 64-Bit Server VM is an unsupported JVM
In the atlassian-bitbucket.log the following can be seen:
2012-11-09 08:27:36,813 ERROR [main] c.a.s.i.j.JdkApplicationEventCheck OpenJDK 64-Bit Server VM is an unsupported JVM. <a href="http://confluence.atlassian.com/x/pQqTE">Supported platforms</a>.
2012-11-09 08:27:36,822 ERROR [main] c.a.j.s.w.c.JohnsonContextLoaderListener Bypassing Spring ApplicationContext initialisation; a previous fatal error was found: OpenJDK 64-Bit Server VM is an unsupported JVM. <a href="http://confluence.atlassian.com/x/pQqTE">Supported platforms</a>.
2012-11-09 08:27:37,077 ERROR [main] c.a.j.s.w.s.JohnsonDispatcherServlet Bypassing SpringMVC dispatcher [spring-mvc] initialisation; Spring initialisation was bypassed
Cause
Previously Bitbucket Server did not support OpenJDK as mentioned in the Supported platforms document. As of Bitbucket Server 2.5 OpenJDK is officially supported. If you have any previous version, there is a check in place that prevents Bitbucket Server from running with it.
Resolution
In order to run Bitbucket Server with OpenJDK:
- Stop Bitbucket Server.
Edit the following line in
<Bitbucket Server Installation Directory>/bin/setenv.sh
for Linux/Unix or<Bitbucket Server Installation Directory>/bin/setenv.bat
for Windows:JVM_SUPPORT_RECOMMENDED_ARGS="-Dbitbucket.allow.openjdk=true"
setenv and environment variable changes in Bitbucket Server 5.0+
Starting with Bitbucket Server 5.0,
setenv.sh
andsetenv.bat
have been removed. The options that were set in this file can now be set via environment variables. Where to set the environment variable depends on which Operating System you're running on.Linux
When using the
atlbitbucket
service on Linux, the environment variables are ignored. You must set the parameters in_start-webapp.sh (or start-bitbucket.sh)
. These values will be read when the service starts.As an example, to set
JVM_SUPPORT_RECOMMENDED_ARGS
, you would add this line to the file:ExampleJVM_SUPPORT_RECOMMENDED_ARGS=-XX:+HeapDumpOnOutOfMemoryError
Windows
Set the parameter as an environment variable for the user running Bitbucket Server. For example, if you want to set
JVM_SUPPORT_RECOMMENDED_ARGS
, create it as an environment variable and assign the appropriate value to it. When Bitbucket Server starts using the startup scripts or service, it will pick up and apply this value.- Start Bitbucket Server.
Or to run Bitbucket Server with Oracle JDK:
- Stop Bitbucket Server.
- Download a Supported JVM from the Oracle Web Site.
- Change the value of the
JAVA_HOME
variable to the Oracle JDK path. - Start Bitbucket Server.