Ubuntu JDK install

1、download jdk install file from offical website( here is oracle ) and file is .rpm;
2、extract rpm file ( here is alien which is needed to be install via cmd sudo apt-get install alien ) [b][color=red]WARNING:[/color][/b] [color=olive]$java-jdk-dir/lib/tools.pack[/color] is needed to unpacked, you can ues the tool in [color=darkred]$java-jdk-dir/bin/unpack200[/color], for more plz visit: [color=indigo]http://blog.renren.com/blog/307478166/720454333?frommyblog[/color];
3、copy dir([color=darkred]$java-extracted-dir/usr/java/$java-jdk-dir[/color]) to /usr/local/java( this dir is my favorite );[color=red]WARNING[/color]: you should [b]change mod of java-jdk-dir[/b], this is very important
4、java_home, classpath and path: you need open file /etc/profile with root user
and add the following codes before umask 022:
[color=olive] JAVA_HOME="/home/lcy/opt/jdk1.6"
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$CLASSPATH
[color=olive] export CLASSPATH[/color]
save file and close. After this ,you need do this in terminal:
sudo update-alternatives --install /usr/bin/java java YOUR-JAVA_HOME/bin/java 300
sudo update-alternatives --install /usr/bin/javac javac YOUR-JAVA_HOME/bin/javac 300

update-alternatives --config java[/color]
at last, you can check in terminal by typing:
java -version
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值