在Red Hat上为root设置JAVA_HOME


1

我在“ / etc / profile”中插入了以下内容

JAVA_HOME = / usr / java / jdk1.6.0_21 export PATH = $ PATH:$ JAVA_HOME / bin

但是,当我从常规帐户中“ sudo su”时,它不会出现上述Java路径:有什么建议吗?

谢谢

Answers:



2

当您这样做时,sudo susu不是登录外壳,因此不会处理文件/ etc / profile。为了使苏登录shell,你可以用它打电话--login-l-选项。因此,请使用sudo su -

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.