jdk的安装

yum install snmp-*
ll
yum -y install patch make gcc gcc-c++ libtool libtool-libs libart_lgpl libart_lgpl-devel autoconf libjpeg libjpeg-devel libpng libpng-devel fontconfig fontconfig-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers pcre glibc glibc-common gd gd-devel gmp-devel apr-devel pd-devel perl pspell-devel libmcrypt-devel libxslt-devel flex openssl openssl-devel net-snmp* sysstat mysql-devel *apr-* cmake pango* rrdtool-perl openssl openssl-devel net-snmp* sysstat mysql-devel


yum -y install patch make gcc gcc-c++ libtool libtool-libs libart_lgpl libart_lgpl-devel autoconf libjpeg libjpeg-devel libpng libpng-devel fontconfig fontconfig-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel libidn libidn-devel pcre glibc glibc-common gd gd-devel gmp-devel apr-devel pd-devel perl pspell-devel libmcrypt-devel libxslt-devel flex openssl openssl-devel net-snmp* sysstat *apr-* cmake pango* rrdtool-perl openssl openssl-devel net-snmp* sysstat



1.jdk的卸载
rpm -qa|grep jdk 查看jdk的安装包
rpm -e rpm包名  卸载

centOS的jdk卸载
rpm -qa | grep jdk
rpm -qa | grep gcj
卸载
yum -y remove java-1.4.2-gcj-compat-1.4.2.0-40jpp.115


2.jdk安装

安装(这里以jdk-1_5_0_09-linux-i586-rpm.bin为例):
将jdk-1_5_0_09-linux-i586-rpm.bin拷贝到服务器
给其运行权限: chomd u+x jdk-1_5_0_09-linux-i586-rpm.bin
运行: ./jdk-1_5_0_09-linux-i586-rpm.bin
安装rpm包: rpm -iv jdk-1_5_0_09-linux-i586.rpm 这样将jdk安装到了/usr/java下

然后修改/etc/profile:
export JAVA_HOME=/usr/java/default
export M2_HOME=/usr/local/maven
export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar


保存,并执行source /etc/profile 

你可能感兴趣的:(jdk)