1.从下面的地址下载最新的JDK 6
http://www.oracle.com/technetwork/java/javase/downloads/
Cent OS 用得是 jdk-6u31-linux-i586.bin
2.运用ftp下载到CentOs 中,我的目录是 /usr/java/
注意下载的时候 要将ftp的传输方式 改为 二进制
命令 : bin
3.安装 jdk
./jdk-6u31-linux-i586.bin
4.更改 /etc/profile 文件
在末尾追加以下信息
JAVA_HOME=/usr/java/jdk1.6.0_31/
JRE_HOME=/usr/java/jdk1.6.0_31/jre/
CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
5.将信心导入
命令 : source /etc/profile
6.测试
java -version
上面2 中如果没有更改ftp的传输方式的话会出现以下错误
The download file appears to be corrupted. Please refer
to the Troubleshooting section of the Installation
Instructions on the download page for more information.
Please do not attempt to install this archive file.
http://www.oracle.com/technetwork/java/javase/downloads/
Cent OS 用得是 jdk-6u31-linux-i586.bin
2.运用ftp下载到CentOs 中,我的目录是 /usr/java/
注意下载的时候 要将ftp的传输方式 改为 二进制
命令 : bin
3.安装 jdk
./jdk-6u31-linux-i586.bin
4.更改 /etc/profile 文件
在末尾追加以下信息
JAVA_HOME=/usr/java/jdk1.6.0_31/
JRE_HOME=/usr/java/jdk1.6.0_31/jre/
CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
5.将信心导入
命令 : source /etc/profile
6.测试
java -version
上面2 中如果没有更改ftp的传输方式的话会出现以下错误
The download file appears to be corrupted. Please refer
to the Troubleshooting section of the Installation
Instructions on the download page for more information.
Please do not attempt to install this archive file.
本文提供了在CentOS上安装JDK6的详细步骤,包括从Oracle官网下载JDK6、通过FTP传输安装包并设置正确的传输模式为二进制、在指定目录下执行安装命令、配置环境变量以及验证安装是否成功。
941

被折叠的 条评论
为什么被折叠?



