# Nexus 启动异常

**URL:** <https://www.isharkfly.com/t/nexus/15630>\
**Category:** DevOps\
**Tags:** nexus\
**Created:** [April 12, 2024, 4:28pm UTC](https://www.isharkfly.com/t/nexus/15630 "2024-04-12T16:28:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [April 12, 2024, 4:28pm UTC](https://www.isharkfly.com/t/nexus/15630/1 "2024-04-12T16:28:05Z")

</div>

在迁移 Nexus 到新的服务器上，我们有下面的异常。

```auto
[root@devops log]# /opt/nexus/bin/nexus start
No suitable Java Virtual Machine could be found on your system.
The version of the JVM must be 1.8.
Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.
[root@devops log]# 

```

这个问题的原因是老的服务器用的 JDK 版本是 11，新服务器用的 JDK 版本是 17。

在这里有路径不匹配的问题。

## 修改文件

需要修改的文件路径在：`/opt/nexus/bin ` 目录下的 nexus 文件。

 ![2024-04-12_12-31-37](https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/2X/0/02dbcef6851c77cf3e94e70ff4a362729d5bf1bd.png)

把这个文件修改为服务器上正确的 Java Home 路径。

我们服务器上安装的是 OpenJDK，当我们进入目录 ：`/usr/lib/jvm` 后，我们可以看  
到下面的内容。

 ![2024-04-12_12-33-44](https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/2X/9/9592c8c5ccb5611d0f173c6cad42e8bef00aa8da.png)

我们的机器上装的是 OpenJDK 17。

根据官方的说法：

Nexus Repository versions up to and including release 3.66.0 require a **Java 8** Runtime Environment (JRE).

Versions 3.67.0+ also support the **Java 11** JRE。

如果你需要使用 JDK 11 的话，你至少需要版本 3.67.0 以上。

当完成上面的 JDK 配置后，重启服务器就可以了。
