I'm having troubles starting OpenTSDB because no JDK is found allthough I've installed it and set JAVA_HOME. Here's what I've done:
1. Install JDK
sudo apt-get install openjdk-8-jdk
2. Set JAVA_HOME
I tried setting JAVA_HOME in 2 different ways:
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
to /etc/environment
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
to .bashrc
3. Download OpenTSDB
wget https://github.com/OpenTSDB/opentsdb/releases/download/v2.3.0/opentsdb-2.3.0_all.deb
4. Install OpenTSDB
dpkg -i opentsdb-2.3.0_all.deb
5. Start OpenTSDB
service opentsdb start
Each time I get the error "* no JDK found - please set JAVA_HOME". I've tried numerous times, what am I doing wrong?
This issue is also present in opentsdb 2.3.1
. To fix this issue you should explicitly write your JAVA_HOME
to the opentsdb init script (at /etc/init.d/opentsdb
)
open the file /etc/init.d/opentsdb
and add the path to your java installation
here is the fix:
JDK_DIRS=" Path_to_your_JDK_here \
/usr/lib/jvm/java-8-oracle /usr/lib/jvm/java-8-openjdk \
/usr/lib/jvm/java-8-openjdk-amd64/ /usr/lib/jvm/java-8-openjdk-i386/ \
\
/usr/lib/jvm/java-7-oracle /usr/lib/jvm/java-7-openjdk \
/usr/lib/jvm/java-7-openjdk-amd64/ /usr/lib/jvm/java-7-openjdk-i386/ \
\
/usr/lib/jvm/default-java"