Ubuntu tomcat7+Java-8-oracle 设置 JDK 路径
2016-08-12 10:50
483 查看
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
Make sure the JAVA_HOME is set properly: if issuing "echo $JAVA_HOME"
does not show any paths, you should add the following lines to your ~./bashrc (if
you want to set it locally ) or if you want to set it globally you should add these to/etc/bash.bashrc :
Now, normally, after reopening the terminal and issuing "sudo service tomcat7 start"
should start the tomcat. But if you see the error above again:
no JDK found - please set JAVA_HOME
Just to this:
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
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
Make sure the JAVA_HOME is set properly: if issuing "echo $JAVA_HOME"
does not show any paths, you should add the following lines to your ~./bashrc (if
you want to set it locally ) or if you want to set it globally you should add these to/etc/bash.bashrc :
#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 "sudo service tomcat7 start"
should start the tomcat. But if you see the error above again:
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
相关文章推荐
- ubuntu安装java jdk,及ant junit tomcat环境变量设置
- Ubuntu tomcat7 设置 JDK 路径
- Ubuntu16.04中把默认JAVA设置为Oracle的JDK!
- ubuntu tomcat6 设置JAVA_HOME
- How To Install Oracle Java 7 (JDK) In Ubuntu(or linuxdeepin12)
- linux查看java jdk安装路径和设置环境变量
- linux查看java jdk安装路径和设置环境变量
- Ubuntu 12.04 / 12.10 安装 Oracle Java 7 (JDK & JRE)
- java tomcat 设置虚拟路径(网上搜的)
- Ubuntu下配置java环境(JDK1.6+eclipse+myeclipse+tomcat)
- Ubuntu - Edgy Eft 下安装配置Java开发环境(JDK 6 + Eclipse WTP + Tomcat + MySQL)
- linux查看java jdk安装路径和设置环境变量
- Oracle Java JDK 7 on Ubuntu Linux
- Ubuntu oracle java 6 jdk 安装
- linux查看java jdk安装路径和设置环境变量
- Ubuntu下的java开发环境配置(jdk+tomcat+mysql+myeclipse)
- JDK、JRE和ubuntu上java环境的设置
- ubuntu安装jdk,ubuntu设置java环境变量
- linux查看java jdk安装路径和设置环境变量
- linux查看java jdk安装路径和设置环境变量