Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing nexus error: The version of the JVM must be at least 1.8 and at most 1.8

Tags:

nexus

nexus3

I have installed Nexus on Ubuntu 18.04 LTS. When I want to start Nexus service I get this error:

nexus[24049]: No suitable Java Virtual Machine could be found on your system.
nexus[24049]: The version of the JVM must be at least 1.8 and at most 1.8.
nexus[24049]: Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.
systemd[1]: nexus.service: Control process exited, code=exited status=83
systemd[1]: nexus.service: Failed with result 'exit-code'.
systemd[1]: Failed to start LSB: nexus.

I have Open JDK version 10.0.2 installed in my system:

openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)

My question is why Nexus uses ONLY JDK8? and am I able to have both JDK versions alongside?

like image 358
Ali Behzadian Nejad Avatar asked Mar 11 '19 23:03

Ali Behzadian Nejad


1 Answers

INSTALL4J_JAVA_HOME is not an environment variable setting. It is configured in the nexus installation directory. You'll need to edit "/bin/nexus" file.

You'll find near the top of that configuration script a commented out line:

#  INSTALL4J_JAVA_HOME_OVERRIDE=

remove the comment tag and set the value to your jdk location. I set mine to a java 1.8 jdk that I installed. (Not the JDK 11.0.4 default dir that some linux installations are prepackaged with. I read somewhere that you must use the Java 1.8 with nexus version 3.x and that other versions will fail. I don't know the truth to that claim, you certainly can try other version to see if they work.)

After doing that, the nexus service was able to start.

I still haven't been able to get access to the nexus manager through a browser via port 8082. I'm just now trying to track that issue down. Probably a configuration issue or something else I need to set up.

like image 126
Tom Rutchik Avatar answered Nov 15 '22 07:11

Tom Rutchik