0

I set my JAVA_HOME variable the follow path: /usr/lib/jvm/jdk11 and when i put the following comand: java -version , it shows me the current version and echo $JAVA_HOME indicates the above path. When I start tomcat the following error message comes up: neither JAVA_HOME nor JRE_HOME variable defined.

I setting up everything right, but the tomcat cant find it.

beard black
  • 41
  • 1
  • 5

2 Answers2

0

Tomcat calls a script, setenv.sh, from catalina.sh.

Create a script called setenv.sh in the directory CATALINA_BASE/bin, and add the line: "export JAVA_HOME=/usr/lib/jvm/jdk11". Make the script executable, i.e. chmod +x setenv.sh

AndyMan
  • 397
  • 1
  • 7
0

You will need to add the following line in your .bashrc file:

export PATH=$PATH:$JAVA_HOME/bin

The .bashrc file is located in the /home directory.

assax24
  • 171
  • 5