Skip to main content
pablol0005
November 30, 2021
Question

Cannot run a script as root user

  • November 30, 2021
  • 3 replies
  • 0 views

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
November 30, 2021

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
November 30, 2021

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
November 30, 2021

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.