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啦