I am trying to set JAVA_HOME so that I can install Apache Solr with the help of this tutorial. I am connected to my server using ssh with root user
To allow the running sh script to install Apache Solr:
mount | grep noexec
Re-mounting file system with exec option:
mount -o remount,exec /dev/md1
Then every time I try to install it using the following commands
I get the following message:
WARNING: /opt/solr-5.3.1 already exists! Skipping extract ... Creating /etc/init.d/solr script ... 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. 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. Service solr installed.
This is what I tried so far:
nano /root/.bash_profile nano /etc/profile
I added the following to the files above at the end and saved them
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-184.108.40.206-0.b17.el6_7.x86_64 export PATH=/usr/lib/jvm/java-1.8.0-openjdk-220.127.116.11-0.b17.el6_7.x86_64/bin:$PATH
That didn't work.
I created the following file /etc/profile.d/java.sh and put in it:
export JRE_HOME=/usr/lib/jvm/java-1.8.0-openjdk-18.104.22.168-0.b17.el6_7.x86_64/jre/ export PATH=$PATH:$JRE_HOME/bin export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-22.214.171.124-0.b17.el6_7.x86_64 export JAVA_PATH=$JAVA_HOME export PATH=$PATH:$JAVA_HOME/bin
And ran the following command:
That also didn't work.
I tried to run the following command:
No luck at all.
But when a run the following commands that is what I get
echo $JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk-126.96.36.199-0.b17.el6_7.x86_64 echo $PATH /usr/lib/jvm/java-1.8.0-openjdk-188.8.131.52-0.b17.el6_7.x86_64/bin:/usr/local/jdk/bin:/usr/lib/jvm/java-1.8.0-openjdk-184.108.40.206-0.b17.el6_7.x86_64/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/lib/jvm/java-1.8.0-openjdk-220.127.116.11-0.b17.el6_7.x86_64/jre//bin:/usr/lib/jvm/java-1.8.0-openjdk-18.104.22.168-0.b17.el6_7.x86_64/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin