日期:2014-05-16 浏览次数:20661 次
# chmod xxx jdk-6u26-linux-x64.bin # ./jdk-6u26-linux-x64.bin
# chmod xxx jdk-6u26-linux-x64-rpm.bin # ./jdk-6u26-linux-x64-rpm.bin
# chmod xxx jdk-6u26-linux-x64.rpm # rpm -ivh jdk-6u26-linux-x64.rpm
JAVA_HOME=/usr/java/jdk1.6.0_26 //指明JDK安装路径,就是刚才安装时所选择的路径 CLASSPATH=.; //为java加载类(class or lib)路径,只有类在classpath中,java命令才能识别 PATH=$PATH:$HOME/bin:$JAVA_HOME/bin //使得系统可以在任何路径下识别java命令 export PATH JAVA_HOME CLASSPATH
JAVA_HOME=/usr/java/jdk1.6.0_26 //指明JDK安装路径,就是刚才安装时所选择的路径 CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar //为java加载类(class or lib)路径,只有类在classpath中,java命令才能识别(必须配置.jar) PATH=$JAVA_HOME/bin:$HOME/bin:$PATH //使得系统可以在任何路径下识别java命令($JAVA_HOME/bin必须放在PATH的最前面) export PATH JAVA_HOME CLASSPATH
source /etc/profile(或source ~/.bash_profile) java -version
# alternatives --install /usr/bin/java java /usr/java/jdk1.5.0_16/bin/java 2 # alternatives --config java
----------------------------------------------- * 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java 2 /usr/java/jdk1.6.0_06/bin/java + 3 /usr/java/jdk1.5.0_16/bin/java
/usr/local/tomcat/bin/startup.sh 若显示 Using CATALINA_BASE: /opt/java/tomcat Using CATALINA_HOME: /opt/java/tomcat Using CATALINA_TMPDIR: /opt/java/tomcat/temp Using JAVA_HOME: /opt/java/jdk1.6.0_26