This question already has an answer here:
- JAVA_HOME should point to a JDK not a JRE 16 answers
I'm trying to run Catalina on Ubuntu Linux using the debug command. I'm getting the following error:
JAVA_HOME should point to a JDK in order to run in debug mode.
/bin/sh died with exit status 1
However, I have tried setting JAVA_HOME in the .bashrc
to all of the following:
export JAVA_HOME="/usr/lib/jvm/java-1.7.0-openjdk-i386/"
export JAVA_HOME="/usr/lib/jvm/java-1.7.0-openjdk-i386"
export JAVA_HOME="/usr/lib/jvm/java-1.7.0-openjdk-i386/jre/bin"
export JAVA_HOME="/usr/lib/jvm/java-1.7.0-openjdk-i386/jre/bin/"
Am I missing anything?
In Debian/Ubuntu run:
to find out your JRE java paths, so your JDK path is the one without
jre
, for example:So you can either
export
this variable or prefix before running the command, e.g.:Method 1 Adding to bashrc will work.
Method 2 But I think a better way is to add it to catalina.sh
Method 3 And even a more cleaner way would be create a env_var.sh (assuming you created env_var.sh in same folder as catalina.h) file and then use the env_var.sh file in catalina.sh like this
Now you can throw your own environment specific settings in this new file and leave catalina.sh at peace. Advantage is you are not messing up catalina.sh and you not dependent on one particular users bash profile.
Simple Example of env_var.sh
I hope it helps :)