InMotion Hosting Support Center

JAVA_HOME /usr/local/jdk not found

Category: How To

openii5
Asked:
2015-07-10 3:34 pm EST

Hits: 1,089
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 -

root@vpsxxxx [/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.

root@vpsxxxx [/opt]# which java
/usr/bin/java

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

root@vpsxxxx [/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/

root@vpsxxxx [/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/

root@vpsxxxx [/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
root@vpsxxxx [/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

root@vpsxxx [~]# 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.

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

1

John-Paul
Staff
30,400 Points
2015-07-10 4:17 pm EST
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

You must login before you can post a comment about this answer.

Like this Question?

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Social Media Login

   
Social Login Joomla

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!