[root@localhost ~]#
[root@localhost ~]# rpm -qa | grep gcj (查看本机自带的)
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
libgcj-4.1.2-46.el5
[root@localhost ~]# rpm -e -nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
-nodeps: unknown option
[root@localhost ~]# rpm -e --nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115 java-1.6.0-openjdk-1.6.0.0-1.2.b09.el5
[root@localhost ~]#
[root@localhost ~]# rpm -qa | grep jdk
[root@localhost ~]# rpm -qa | grep gcj
libgcj-4.1.2-46.el5
[root@localhost ~]#上传完成安装包,解压或者怎样完成后------->
[root@localhost tmp]# rpm -ivh jdk-7u25-linux-x64.rpm
Preparing... ########################################### [100%]
1:jdk ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
tar包安装
新建文件夹/usr/java/
[root@localhost usr]# mkdir java
[root@localhost usr]# cd ~/tmp
在etc/profile文件下添加 -------jdk信息可以find查下,再写。
export JAVA_HOME=/usr/java/jdk1.7.0_29
export CLASSPATH=/usr/java/jdk1.7.0_29/lib
export PATH=$JAVA_HOME/bin:$PATH
[root@localhost ~]#
[root@localhost ~]# echo $JAVA_HOME 验证是否生效
/usr/java/jdk1.7.0_79
[root@localhost ~]#
[root@localhost ~]# echo $PATH
/usr/java/jdk1.7.0_79/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@localhost ~]# echo $CLASSPATH
/usr/java/jdk1.7.0_79/lib
[root@localhost ~]#
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
[root@localhost ~]#
1)下载apache-tomcat-7.0.62.tar.gz 下载页:http://tomcat.apache.org/download-70.cgi
2)#tar -zxvf apache-tomcat-7.0.62.tar.gz ;//解压
3)#cp -R apache-tomcat-7.0.62 /usr/local/tomcat ;//拷贝apache-tomcat-7.0.62到/usr/local/下并重命名为tomcat
4) /usr/local/tomcat/bin/startup.sh; //启动tomcat
显示 Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TEMDIR: /usr/local/tomcat/temp
Using JAVA_HOME: /usr/java/jdk1.7.0_62
到此tomcat已经安装完成,现在使用浏览器访问 http://localhost:8080 or ip:8080 出现tomcat默认页面,说明已经安装成功。