linux环境下配置jdk、tomcat等

2017-11-01  本文已影响21人  山东菏泽朱志强

一. 配置JDK

  1. 下载jdk,这里下载的是linux64位的tar压缩包
    http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  2. 解压
    tar xzfv jdk-8u151-linux-x64.tar.gz
  3. 设置环境变量
    vi /etc/profile
export JAVA_HOME=/usr/local/jdk1.8.0_151
export PATH=$PATH:${JAVA_HOME}/bin
  1. 执行,刷新环境变量设置
    source /etc/profile
  2. 验证
    java -version
    如果打印出版本信息,完成

二、设置tomcat

  1. 下载tomcat
    https://tomcat.apache.org/download-70.cgi
  2. 解压
    unzip apache-tomcat-7.0.82.zip
  3. 设置环境变量
    vi /etc/profile
export CATALINA_HOME=/usr/local/apache-tomcat-7.0.82
export PATH=$PATH:${CATALINA_HOME}/bin
  1. 执行,刷新环境变量设置
    source /etc/profile
  2. 给.sh文件授予执行权限
cd /usr/local/apache-tomcat-7.0.82/bin
chmod u+x *.sh
  1. 验证
    执行 startup.sh
    出现:
Using CATALINA_BASE:   /usr/local/apache-tomcat-7.0.82
Using CATALINA_HOME:   /usr/local/apache-tomcat-7.0.82
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-7.0.82/temp
Using JRE_HOME:        /usr/local/jdk1.8.0_151
Using CLASSPATH:       /usr/local/apache-tomcat-7.0.82/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.82/bin/tomcat-juli.jar
Tomcat started.
就成功了

三、配置nodejs

  1. 下载6.10.1版本
    https://npm.taobao.org/mirrors/node/v6.10.1/
  2. 解压
    tar xzfv node-v6.10.1-linux-x64.tar.gz
  3. 配置环境变量
vi /etc/profile
export PATH=$PATH:/usr/local/node-v6.10.1-linux-x64/bin
  1. 执行,刷新环境变量设置
    source /etc/profile
  2. 验证
node -v
v6.10.1
上一篇下一篇

猜你喜欢

热点阅读