在腾讯云上启用 Nexus 私服的一些问题
Linux 服务器信息
Linux VM-4-17-centos 4.18.0-305.19.1.el8_4.x86_64 #1 SMP Wed Sep 15 15:39:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
x86_64
{% note primary %}
报错
{% endnote %}
WARNING: ************************************************************
WARNING: Detected execution as "root" user. This is NOT recommended!
WARNING: ************************************************************
Starting nexus
{% note success %}
解决方案
{% endnote %}
对于这个问题网上给出了很多的解决办法,但是既然给出的问题是“{% label danger@不能使用 root用户 %}”,那么我的解决方案就是使用{% label success@exit %}命令退出 {% label danger@root %} 模式后重新启动。
{% note primary %}
问题
{% endnote %}
由于 Nexus 的默认端口 8081 与开发中的 8080 比较接近,一般开发中我会将 8081 作为第二项目的启动接口(比如 Vue 等),因此我将 Nexus 的默认端口修改为了 3939。
{% note success %}
修改方法如下:
{% endnote %}
# 执行以下命令 | 打开 nexus 的默认配置文件
vim ./etc/nexus-default.properties
# 添加以下代码后重启 Nexus
application-port=3939
{% note primary %}
问题
{% endnote %}
明明安装了 jdk1.8,配置好了环境变量,但是运行还是出现以下错误
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.
{% note success %}
解决方案
{% endnote %}
在使用 vim 打开 /usr/local/nexus/nexus-3.38.0-01/bin/nexu
# 使用 vim 打开 bin 文件夹下的 nexus 文件
vim /usr/local/nexus/nexus-3.38.0-01/bin/nexus
# 添加如下代码
INSTALL4J_JAVA_HOME_OVERRIDE=/usr/local/jdk/jdk8
关于 vim
如果不熟悉 vim 操作的话可以点击此处查看 vim 相关操作