JAVA_HOME /usr/local/jdk not found

Avatar
  • Answered
I am having trouble with the JAVA_HOME variable set in the VPS. I yum installed Java which had no problem. I install Solr which also had no problem other than when trying to start. It is looking in JAVA_HOME (/usr/local/jdk) which is the variable that is set but does not exist.

I am worried about changing settings like JAVA_HOME within the VPS - I don't want to break any ability to work with the standard VPS support or fuyure program installations.

I tried a symlink no success.

Being new to VPS, I am wondering ...
How much I can do within the VPS without causing problems?
Can I treat the VPS like my home server?
How do I fix this problem without creating bigger problems?


Additional info follow regarding the current problem -

[email protected] [/opt]# service solr status
The currently defined JAVA_HOME (/usr/local/jdk) refers
to a location where Java could not be found. Aborting.
Either fix the JAVA_HOME variable or remove it from the
environment so that the system PATH will be searched.

[email protected] [/opt]# which java
/usr/bin/java

[email protected] [/opt]# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Jul 10 10:08 /usr/bin/java -> /etc/alternatives/java/

[email protected] [/opt]# ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 60 Jul 10 13:07 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/

[email protected] [/opt]# ls -l /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/
total 12
drwxr-xr-x 3 root root 4096 Jul 10 10:08 ./
drwxr-xr-x 3 root root 4096 Jul 10 10:08 ../
drwxr-xr-x 4 root root 4096 Jul 10 10:08 jre/

[email protected] [/opt]# ls -l /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre
total 16
drwxr-xr-x 4 root root 4096 Jul 10 10:08 ./
drwxr-xr-x 3 root root 4096 Jul 10 10:08 ../
drwxr-xr-x 2 root root 4096 Jul 10 13:36 bin/
drwxr-xr-x 10 root root 4096 Jul 10 10:08 lib/

I tried adding a symlink to point to the "which java" result still getting the same message -> "The currently defined JAVA_HOME (/usr/local/jdk) refers to a location where Java could not be found." This is what I tried

ln -s /usr/bin/java /usr/local/jdk/java
with the reuslt
[email protected] [/opt]# ls -l /usr/local/jdk/
total 8
drwxr-xr-x 2 root root 4096 Jul 10 13:26 ./
drwxr-xr-x 22 root root 4096 Jul 10 13:26 ../
lrwxrwxrwx 1 root root 13 Jul 10 13:26 java -> /usr/bin/java/

Same message given when trying to start Solr.

One last piece of info

[email protected] [~]# ls -l /usr/lib/jvm
total 12
drwxr-xr-x 3 root root 4096 Jul 10 10:08 ./
drwxr-xr-x 29 root root 4096 Jul 10 10:08 ../
drwxr-xr-x 3 root root 4096 Jul 10 14:57 java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/
lrwxrwxrwx 1 root root 21 Jul 10 10:08 jre -> /etc/alternatives/jre/
lrwxrwxrwx 1 root root 27 Jul 10 10:08 jre-1.8.0 -> /etc/alternatives/jre_1.8.0/
lrwxrwxrwx 1 root root 35 Jul 10 10:08 jre-1.8.0-openjdk -> /etc/alternatives/jre_1.8.0_openjdk/
lrwxrwxrwx 1 root root 51 Jul 10 10:08 jre-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64 -> java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre/
lrwxrwxrwx 1 root root 29 Jul 10 10:08 jre-openjdk -> /etc/alternatives/jre_openjdk/

Any help is appreciated.
Avatar
johnpaulb-imhs1

Hello openii5,

Thank you for contacting us about the "JAVA_HOME" not found error. Since you are logged in as root, you have full access to your server. This means you can definitely make non-standard changes, and cause problems. How much you can do without causing problems, depends on your skill level, and what specifically you are doing.

Since you have root access to your server, you have the ability to treat the server as needed to setup your sites. Be sure to stay within terms of service.

At this point it may be safer to submit a ticket to Live Support requesting assistance setting the "JAVA_HOME" location.

Let us know if you have any further questions.

Thank you,

John-Paul