Centos7.3安装jdk和maven

时间:2024-01-11 12:14:44

安装jdk和maven

            通过winscp上传jdk

            解压

                tar -zxvf jdk-8u91-linux-x64.tar.gz -C /usr/local/

            设置变量

                vim /etc/profile

        在最下面,按i进入insert模式,添加一下内容

        JAVA_HOME=/usr/local/jdk1.8.0_91

                    export JAVA_HOME

                    CLASSPATH=.:$JAVA_HOME/lib

                    export CLASSPATH

                    PATH=$PATH:$JAVA_HOME/bin:$CLASSPATH

                    export PATH

                 按esc进入命令行模式,再按:wq保存退出

             激活配置

                 source /etc/profile

            通过winscp上传maven

             解压maven

             tar -zxvf apache-maven-3.5.3-bin.tar.gz -C /usr/local/

            配置maven环境变量

             vim /etc/profile

        在最下面,按i进入insert模式,添加一下内容

            MAVEN_HOME=/usr/local/apache-maven-3.5.3

                    export MAVEN_HOME

                    PATH=$PATH:$MAVEN_HOME/bin

                    export PATH

                按esc进入命令行模式,再按:wq保存退出

                 激活配置

                     source /etc/profile