zoukankan      html  css  js  c++  java
  • 安装java

    docker run --privileged -it --name java --restart=always -p 8080:8080 centos:7.4.1708 /usr/sbin/init

    安装jdk

    [root@lvhanzhi ~]# ls jdk-8u121-linux-x64.tar.gz
    jdk-8u121-linux-x64.tar.gz
    [root@lvhanzhi ~]# docker cp jdk-8u121-linux-x64.tar.gz java:/root
    [root@lvhanzhi ~]# docker exec -it java /bin/bash
    [root@96534033bdea /]# cd /root
    [root@96534033bdea ~]# ls /root/jdk-8u121-linux-x64.tar.gz
    [root@96534033bdea ~]# tar xf jdk-8u121-linux-x64.tar.gz
    [root@96534033bdea ~]# mv jdk1.8.0_121/ /usr/local/jdk1.8
    [root@96534033bdea ~]# ln -s /usr/local/jdk1.8 /usr/local/jdk #做软链接(方便日后升级)
    [root@96534033bdea ~]# vi /etc/profile.d/jdk1.8.sh
    export JAVA_HOME=/usr/local/jdk1.8
    export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    export PATH=$PATH:$JAVA_HOME/bin
    [root@96534033bdea ~]# source /etc/profile
    [root@96534033bdea ~]# java -version
    java version "1.8.0_121"
    Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

    安装tomcat

    [root@lvhanzhi ~]# docker cp apache-tomcat-8.0.38.tar.gz java:/root
    [root@96534033bdea ~]# ls apache-tomcat-8.0.38.tar.gz
    [root@96534033bdea ~]# tar xf apache-tomcat-8.0.38.tar.gz
    [root@96534033bdea ~]# mv apache-tomcat-8.0.38 /usr/local/tomcat-8.0.38
    [root@96534033bdea ~]# ln -s /usr/local/tomcat-8.0.38 /usr/local/tomcat
    [root@96534033bdea ~]# cd /usr/local/tomcat/webapps #进入工作目录(把没编译的代码放进去)

  • 相关阅读:
    修改sqlserver2008中表的schema
    MongoDB学习笔记06
    MongoDB学习笔记05
    MongoDB学习笔记04
    在IIS Express中调试时无法读取配置文件
    Spring 集成Redis
    Java操作Redis(代码演示)
    Redis的一些常用命令操作
    Redis安装步骤
    如何彻底删除电脑安装的软件程序?
  • 原文地址:https://www.cnblogs.com/lvhanzhi/p/11356864.html
Copyright © 2011-2022 走看看