If you insist running as root, then set the environment variable RUN_AS_USER=root...

If you insist running as root, then set theenvironment variable RUN_AS_USER=root before running this script.

        背景

        今天笔者在配置Nexus的时输入命令 ./nexus start后出现“ If you insist running as root, then set thee nvironment variable RUN_AS_USER=root before running this script. ”的警告信息。大概的意思是:如果你想使用root用户,那么在运行开始脚本之前应该设置环境变量”RUN_AS_USER=root"。

        

        解决方法

        关于这个问题共有两种解决方法,一种是临时解决,一种是永久的解决。

        临时方法

        

        输入:export RUN_AS_USER=root 后在执行 ./nexus start 运行结果如下图:

        

        永久方法

        在系统用配置即可,输入:vi /etc/profile向其中加入exportRUN_AS_USER=root,修改后保存退出,如下图

        

        修改完之后,先关闭nexus,再启动,如下图

        

        简简单单的几步就OK啦

原文地址:https://www.cnblogs.com/adolfmc/p/5877040.html