Ubuntu tomcat7+Java-8-oracle 設定 JDK 路徑
阿新 • • 發佈:2019-02-15
sudo tar -xzf jdk-8u25-linux-x64.tar.gz
mv .. /usr/lib/jvm/java-8-oracle
If you are a newbie like me, you might have the same problem as me when you wanted to start the tomcat7 on ubuntu:
- no JDK found - please set JAVA_HOME
#Java Environment Variable
JAVA_HOME=/usr/lib/jvm/jdk1.7.0/
export JAVA_HOME
JRE_HOME=/usr/lib/jvm/jdk1.7.0/jre
export JRE_HOME
PATH=$PATH:$JAVA_HOME:$JRE_HOME
export PATH
Now, normally, after reopening the terminal and issuing "
- no JDK found - please set JAVA_HOME
Just to this: "vim /etc/default/tomcat7"
and
uncomment the line that sets the JAVA_HOME variable:
Now run the tomcat. This should do the trick.
if the problem still there.
Just : "vim /etc/init.d/tomcat7"
JDK_DIRS="/usr/lib/jvm/j ava-8-oracle /usr/lib/jvm/default-java ${OPENJDKS} /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-7-oracle"
there should be OK now.
plus. you can edit jvm memory size by edit the JAVA_OPTS in /etc/default/tomcat7