1
操作系统:manjaro

Jdk11

0.将下载后解压好的jdk文件夹复制到指定目录
sudo cp -r jdk-11 /usr/lib/jvm

1.用sublime打开/etc/profile文件
sudo subl profile

2.将下面2句添入末尾


export JAVA_HOME=/usr/lib/jvm/jdk-11
export JRE_HOME=$JAVA_HOME/  #注意jdk11解压后没有jre目录,所以这里直接配成$JAVA_HOME/即可
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/
export PATH=$JAVA_HOME/bin:$PATH

3.使其生效
source /etc/profile

4.检验

  • 输入java -version ,出现:

    java version "11" 2018-09-25
    Java(TM) SE Runtime Environment 18.9 (build 11+28)
    Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11+28, mixed mode)
    
  • 输入javac -version ,出现:

    javac 11
    


Tomcat

0.解压缩下载的tomcat压缩包
tar -zxvf apache-tomcat-9.0.26.tar.gz

1.创建文件夹
sudo mkdir /usr/local/tomcat

2.复制解压后的tomcat文件夹至创建好的目录
sudo cp -r apache-tomcat-9.0.26 /usr/local/tomcat

3.发现没有读写查权限,于是开放tomcat及其子目录的全部权限,-R表示启动递归处理
sudo chmod -R 777 tomcat

4.进入bin文件夹,启动tomcat,输入
./startup.sh

5.bash出现:


Using CATALINA_BASE:   /usr/local/tomcat/apache-tomcat-9.0.26
Using CATALINA_HOME:   /usr/local/tomcat/apache-tomcat-9.0.26
Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-9.0.26/temp
Using JRE_HOME:        /usr/lib/jvm/jdk-11
Using CLASSPATH:       /usr/local/tomcat/apache-tomcat-9.0.26/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-9.0.26/bin/tomcat-juli.jar
Tomcat started.

6.在浏览器地址栏输入http://localhost:8080/
出现了那幅经典的猫图,成功

7.关闭tomcat
./shutdown.sh

如果想全局执行startup.shshutdown.sh这两个启动及停止脚本,可以给这两个脚本配置软链接,就不用每次都跑到tomcat/bin目录下执行了


Maven

0.解压
tar -zxvf apache-maven-3.6.2-bin.tar.gz

1.创建文件夹
sudo mkdir /opt/maven

2.复制解压后的目录至创建好的文件夹
sudo cp -r apache-maven-3.6.2 /opt/maven

3.打开环境配置
sudo subl /etc/profile

3.1.于文末添入:




MAVEN_HOME=/opt/maven/apache-maven-3.6.2

export PATH=$PATH:$MAVEN_HOME/bin


4.使其生效
source /etc/profile

5.检查是否配置成功,输入:
mvn -v

5.1.如下,bash出现:


Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T23:06:16+08:00)
Maven home: /opt/maven/apache-maven-3.6.2
Java version: 11, vendor: Oracle Corporation, runtime: /usr/lib/jvm/jdk-11
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "5.2.11-1-manjaro", arch: "amd64", family: "unix"

成功.


DEFAULT
19 声望2 粉丝