1.  首页
  2.  博客
  3. Debian 配置JDK 环境变量

Debian 配置JDK 环境变量


首先下载JDK:

http://www.oracle.com/technetwork/java/javase/downloads/jdk6-jsp-136632.html

安装 JDK:

$cd /opt
$chmod 755 jdk-6u21-linux-i586.bin
$./jdk-6u21-linux-i586.bin

配置环境变量:

$cat >> /etc/profile
export JAVA_HOME='/opt/jdk1.6.0_21/'
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib/
export PATH=$PATH:$JAVA_HOME/bin
export JRE_HOME=$JAVA_HOME/jre

$source /etc/profile

检查java配置

$java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)

评论 0