注意,不要使用root用戶來安裝軟件译柏,會直接安裝在root用戶的目錄下置蜀,其他用戶無權(quán)限訪問奈搜。
使用Jenv環(huán)境安裝工具來搭建Java運(yùn)行環(huán)境,以下是各個命令使用指南盯荤。
創(chuàng)建目錄結(jié)構(gòu)
mkdir -p /usr/local
安裝zip | unzip
yum install zip unzip
01-1 安裝Jenv
curl -L -s get.jenv.io | bash
Thanks for using
___ _______ _____ ___ ___ ___
|" | /" "|(\" \|" \|" \ /" |
|| |(: ______)|.\\ \ |\ \ // /
|: | \/ | |: \. \\ | \\ \/. ./
___| / // ___)_ |. \ \. | \. //
/ :|_/ )(: "|| \ \ | \\ /
(_______/ \_______) \___|\____\) \__/
Will now attempt installing...
Looking for a previous installation of JENV...
Looking for unzip...
Looking for curl...
Installing jenv scripts...
Download script archive...
Extract script archive...
Download Central repository...
Attempt update of bash profiles...
Updated existing /home/jenv/.bash_profile
Updated existing /home/jenv/.bashrc
Attempt create zsh profiles...
All done!
Please open a new terminal, or run the following in the existing one:
source /home/jenv/.jenv/bin/jenv-init.sh
Then issue the following command:
jenv help
Enjoy!!!
01-1.1 執(zhí)行source命令馋吗,初始化jenv
[jenv@localhost ~]$ source /home/jenv/.jenv/bin/jenv-init.sh
01-1.2 更新jenv
[fengwuze@localhost local]$ jenv selfupdate
Updating jenv...
Purge existing scripts...
Download new scripts to: /home/fengwuze/.jenv/tmp/jenv-0.1.0.zip
Extract script archive...
jenv upgraded successfully!
Updating all repositories
Begin to update central
central updated!
Repositories upgraded!
01-1.3 查看某個軟件的版本
[fengwuze@localhost local]$ jenv list java
Available java Versions
=========================
1.8.0_77
1.8.0_71
1.8.0_60
1.8.0_51
1.8.0_45
01-1.4 更新jenv倉庫
[fengwuze@localhost local]$ jenv repo update
Updating all repositories
Begin to update central
central updated!
Repositories upgraded!
01-1.5 缺省指定軟件版本
jenv default java 1.8.0_71
01-2 安裝jdk
[root@localhost ~]$ mkdir -p /user/local/jdk1.6.45
[fengwuze@localhost ~]$ jenv install java 1.6.0_45
Downloading: java 1.6.0_45
Downloading http://get.jenv.mvnsearch.org/download/java/java-1.6.0_45-x64.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 84.8M 100 84.8M 0 0 528k 0 0:02:44 0:02:44 --:--:-- 604k
Do you want java 1.6.0_45 to be set as default? (Y/n): Y
Setting java 1.6.0_45 as default.
Done installing!
01-2.1 檢查jdk的版本
[fengwuze@localhost ~]$ java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
02-1.1 安裝tomcat
[fengwuze@localhost ~]$ jenv install tomcat 7.0.68
Installing: tomcat 7.0.68
Parsing http://jenv.mvnsearch.org/candidate/tomcat/download/7.0.68/Linux/x86_64
Found a previously downloaded tomcat 7.0.68 archive. Not downloading it again...
Do you want tomcat 7.0.68 to be set as default? (Y/n): y
Setting tomcat 7.0.68 as default.
Done installing!
[fengwuze@localhost ~]$
02-1.2 創(chuàng)建多個tomcat目錄
mkdir -p /user/local/{tomcat_1,tomcat_2,tomcat_3,tomcat_4}
02-1.3 復(fù)制多份tomcat
cp -r /home/fengwuze/.jenv/candidates/tomcat/7.0.68/*.* /user/local/tomcat_1
cp -r /home/fengwuze/.jenv/candidates/tomcat/7.0.68/*.* /user/local/tomcat_2
cp -r /home/fengwuze/.jenv/candidates/tomcat/7.0.68/*.* /user/local/tomcat_3
cp -r /home/fengwuze/.jenv/candidates/tomcat/7.0.68/*.* /user/local/tomcat_4
QA##
安裝zip、unzip###
yum install zip unzip
Tomcat啟動慢的問題解決方案
https://blog.csdn.net/youngage/article/details/43020711
修改$CATALINA_BASE/conf/catalina.properties文件秋秤,添加org.apache.el.parser.SKIP_IDENTIFIER_CHECK=true選項宏粤。