Skip to main content
pablol0005
New Participant
Nov 30, 2021 12:57 PM UTC
Question

Cannot run a script as root user

Dear all,

I am facing an issue while I try to run the appian status.sh script  as root user despite the ownership is root.

I am getting the following error:

ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

Any idea of how I can run it as root?

Thanks beforehand.

Kind regards,

3 replies

stefanhelzle0001
Brainy
Nov 30, 2021 1:26 PM UTC

Did you try to google the error message? There seems to be a good post in Stackoverflow

https://stackoverflow.com/questions/64359564/error-java-home-is-not-set-and-no-java-command-could-be-found-in-your-flutter

I think this is not related to whether you work as root user or not.

pablol0005
New Participant
Nov 30, 2021 1:40 PM UTC

I did, but I am working with Red Hat not Windows nor Ubuntu

I can run the script when I log as my other user but not root.

stefanhelzle0001
Brainy
Nov 30, 2021 1:53 PM UTC

OK, but setting an environment variable for your user ist similar to any other Linux.

BTW, working as root is not considered a best practice.