Debian下安裝Java

xuniji123發表於2008-08-26

下載jdk-6u10-rc-bin-b28-linux-i586-21_jul_2008.bin

複製到/usr/soft/java

並在目錄/usr/soft/java

執行./ jdk-6u10-rc-bin-b28-linux-i586-21_jul_2008.bin將開始安裝

安裝完成後,在目錄/usr/soft/java下下生成jdk1.6.0_10資料夾

為了方便,將其重新命名為jdk

mv jdk1.6.0_10 jdk

設定環境變數PATHJAVA_HOMEJRE_HOMECLASSPATH,修改/etc/profile檔案如下:

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))

# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "`id -u`" -eq 0 ]; then

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

else

PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"

fi

if [ "$PS1" ]; then

if [ "$BASH" ]; then

PS1='u@h:w$ '

else

if [ "`id -u`" -eq 0 ]; then

PS1='# '

else

PS1='$ '

fi

fi

fi

PATH=$PATH:/usr/soft/java/jdk/bin:/usr/soft/java/jdk/jre/bin

JAVA_HOME=/usr/soft/java/jdk

JRE_HOME=/usr/soft/java/jdk/jre

CLASSPATH=.:/usr/soft/java/jdk/lib/tools.jar:/usr/soft/java/jdk/lib/dt.jar

TOMCAT_HOME=/usr/soft/tomcat/tomcat6

CATALINA_HOME=/usr/soft/tomcat/tomcat6

export PATH

export JAVA_HOME

export JRE_HOME

export CLASSPATH

export TOMCAT_HOME

export CATALINA_HOME

umask 022

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8271432/viewspace-1009577/,如需轉載,請註明出處,否則將追究法律責任。

相關文章