JAVA_ Home cannot find sudo
•
Java
I have a bash script on a Linux box that runs jar files When I log in as a regular user, I do not have permission to run scripts, but the following logs will be printed:
*INFO * Using JVM found at /opt/jdk6/bin/java
When I try to use sudo's script, it gives:
*ERROR* Unable to locate java,please make sure java is installed and JAVA_HOME set
I have put Java_ Home is set to the same path as above – echo $Java can be used_ Home & it is also set as an option in the script I'm glad the script isn't a problem - it's a default cq5 control script & I have no problem using it on dozens of other boxes I'm not sure what I did wrong on it. Suppose this is the Linux setting I missed?
Can I access the Java I set up when I run the sudo command_ HOME?
Solution
By default, sudo clears the environment of generated commands Hold by - E:
sudo -E env
Compared to:
sudo env
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码