解决Nexus 3.XX Jdk版本问题(亲测有效)

时间:2024-03-20 11:44:50

解决Nexus 3.XX Jdk版本问题

Nexus 3++版本 必须要Jdk1.8

一、在启动Nexus 3++版本的时候抛错

[email protected]:~/Develop/Nexus/nexus-3.15.2-01/bin$ ./nexus start
No suitable Java Virtual Machine could be found on your system.
The version of the JVM must be at least 1.8 and at most 1.8.
Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.

这里说的很清楚,必须最低是Jdk1.8,最高是Jdk1.8,意思是只能是Jdk1.8版本的。

二、但是我本地是JDK12

[email protected]:~/Develop/Nexus/nexus-3.15.2-01/bin$ java -version
java version "12" 2019-03-19
Java(TM) SE Runtime Environment (build 12+33)
Java HotSpot(TM) 64-Bit Server VM (build 12+33, mixed mode, sharing)
[email protected]:~/Develop/Nexus/nexus-3.15.2-01/bin$ 

三、解决办法

下载jdk1.8并解压缩放在本地,不需要给它配置环境变量,将Nexus的启动Jdk改成本地的jdk1.8所在的位置。

1.本地Jdk1.8 的安装位置

[email protected]:~/Develop/Jdk/jdk1.8.0_201$ pwd
/home/ubuntu/Develop/Jdk/jdk1.8.0_201
[email protected]:~/Develop/Jdk/jdk1.8.0_201$ 

2.修改nexus启动文件

[email protected]:~/Develop/Nexus/nexus-3.15.2-01/bin$ ls
contrib  nexus  nexus.rc  nexus.vmoptions
[email protected]:~/Develop/Nexus/nexus-3.15.2-01/bin$

3.编辑

vi nexus

解决Nexus 3.XX Jdk版本问题(亲测有效)
4.重新启动

./nexus start

注:

./nexus start     启动
./nexus stop      停止
./nexus restart   重启

查看命令:

[email protected]:~/Develop/Nexus/nexus-3.15.2-01/bin$ ./nexus statu
Usage: ./nexus {start|stop|run|run-redirect|status|restart|force-reload}

好啦,祝工作顺利!