Debian Lenny下的JDK安装与配置
以前用过一段时间的ubuntu,写过一个使用alternatives配置多个JDK的方法(http://arthurln.iteye.com/admin/blogs/76379),最近开始用debian了,虽然都是debian内核,安装和配置上还是有一些不同。
1、添加non-free源
# gedit /etc/apt/sources.list
下边是我的配置,仅作参考
deb http://ftp.us.debian.org/debian/ lenny main contrib non-free deb-src http://ftp.us.debian.org/debian/ lenny main contrib non-free deb http://security.debian.org/ lenny/updates main deb-src http://security.debian.org/ lenny/updates main deb http://volatile.debian.org/debian-volatile lenny/volatile main deb-src http://volatile.debian.org/debian-volatile lenny/volatile main deb http://www.backports.org/debian lenny-backports main contrib non-free deb-src http://www.backports.org/debian lenny-backports main contrib non-free
更新软件列表
# aptitude install debian-backports-keyring # aptitude update
2、下载并安装jdk
# aptitude install sun-java6-jdk
3、替换系统中现存的java环境
# update-java-alternatives -s java-6-sun
4、添加环境变量(跟其他系统下一样,这是可选的)
# gedit /etc/environment
添加
JAVA_HOME=/usr/lib/jvm/java-6-sun/ JRE_HOME=/usr/lib/jvm/java-6-sun/jre CLASSPATH=.:/usr/lib/jvm/java-6-sun/lib/dt.jar:/usr/lib/jvm/java-6-sun/lib/tools.jar
5、使环境变量生效
source /etc/environment
相关推荐
lonesomer 2020-09-17
Locksk 2020-10-12
佛系程序员J 2020-10-10
gdb 2020-09-14
zousongshan 2020-08-10
hell0kitty 2020-07-28
malonely 2020-07-20
missingmuch 2020-07-19
eternityzzy 2020-07-19
wangrui0 2020-06-28
一世为白 2020-06-21
MAC2007 2020-06-16
凉白开 2020-06-17
zhangwentaohh 2020-06-14
liangston 2020-06-14
linzb 2020-06-14
89421478 2020-06-12