LinuxでJDKをインストールし、環境変数を設定
1.jdk-1_をインターネットでダウンロード5_0_22-linux-i586.bin
- [root@localhost jboss]# cd /usr/tmp
- [root@localhost tmp]# ls
- jdk-1_5_0_22-linux-i586.bin
- [root@localhost tmp]# chmod +x ./jdk-1_5_0_22-linux-i586.bin
- [root@localhost tmp]# ./jdk-1_5_0_22-linux-i586.bin
- Do you agree to the above license terms? [yes or no] y
- .
- .
- .
- Press Enter to continue.....
-
- Done.
- [root@localhost tmp]# ls
- jdk1.5.0_22 jdk-1_5_0_22-linux-i586.bin
- [root@localhost usr]# mkdir /usr/java
- [root@localhost usr]# cp -fr /usr/tmp/jdk1.5.0_22 /usr/java/
- [root@localhost usr]# cd java/
- [root@localhost java]# ls
- jdk1.5.0_22
- [root@localhost java]# vi /etc/profile
- #/etc/profile
- JAVA_HOME="/usr/java/jdk1.5.0_22"
- CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
- PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
-
- export PATH ... JAVA_HOME CLASSPATH
-
- [root@localhost ~]# java -version
- java version "1.5.0_22"