一、安装配置JDK //如果应用不需要高版本的JDK的话,可以不单独安装JDK
1. 安装JDK # chmod a+x jdk-1_5_0_15-linux-i586.bin # ./jdk-1_5_0_15-linux-i586.bin # mv jdk1.5.0_15 /usr/local/jdk //JDK安装路径为 /usr/local/jdk
2. 配置环境变量 2.1 修改 /etc/profile # vi /etc/profile # 添加3行到/etc/profile中 export JAVA_HOME=/usr/local/jdk export PATH=:$PATH export CLASSPATH=$JAVA_HOME/lib 2.2 使 /etc/profile 设置立即生效 # source /etc/profile 2.3 检测JDK # java -version //测试,出现以下信息说明安装JDK正确 java version "1.5.0_15" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15-b04) Java HotSpot(TM) Client VM (build 1.5.0_15-b04, mixed mode, sharing)