I am on CentOS 7.5 and installing OpenJDK 11 from Adopt OpenJDK. It doesn't have an installer package so I am manually putting it in
/usr/share. I then create the file
/etc/profile.d/java.sh to set up
JAVA_HOME and put the java executable on the path. When I run
java -version from my own account it works fine. When I run
sudo java -version it says java: command not found. Every time I try to search if someone else has had this problem I just keep getting the responses to create the
/etc/profile.d file. Any ideas?
This is a fresh install of CentOS 7.5 on an Azure VM.