日期:2014-05-16  浏览次数:20676 次

Linux Mint 13 配置JAVA 环境

0.1--下载

????????????? JAVA JDK下载地址:

????????????? http://www.oracle.com/technetwork/java/javase/downloads/index.html

????????????? 点击DOWNLOAD JDK,我下载的是这个

????????????? Linux x64 - Self Extracting Installer //jdk-6u25-linux-x64.bin //81.36 MB

????????????? 直接用FireFox下载保存

0.2--安装

????????????? wuyexiong@wuyexiong-Ubuntu:/usr/lib/jvm/java$ sudo cp /home/wuyexiong/下载/jdk-6u25-linux-x64.bin ./

????????????? 进入:/usr/lib/jvm/java该目录,将jdk复制到当前目录

????????????? 执行命令sudo chmod +x jdk-6u25-linux-x64.bin,为JDK增加可执行权限

? ? ? ? ? ? ? 执行命令sudo ./jdk-6u25-linux-x64.bin,安装JDK至当前目录

?

0.3--配置

???????????? 执行sudo gedit /etc/environment,添加配置

???????????? PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java/jdk1.6.0_25/bin"
???????????? CLASSPATH=".:/usr/lib/jvm/java/jdk1.6.0_25/bin/lib"
???????????? JAVA_HOME="/usr/lib/jvm/java/jdk1.6.0_25"

?

???????????? sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java/jdk1.6.0_25/bin/java 300

???????????? sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java/jdk1.6.0_25/bin/javac 300

???????????? 然后是sudo update-alternatives --config java配置首选项,敲入数字做选择

???????????? 因为Ubuntu11.04中好像默认没有安装任何的javaJdk,所以你安装配置了之后

???????????? 执行java -version查看

???????????? java version "1.6.0_25"
??????????? Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
??????????? Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)

???????????? 以上信息,OK