博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[转]Debian 7 安装 Java JDK
阅读量:6153 次
发布时间:2019-06-21

本文共 2578 字,大约阅读时间需要 8 分钟。

参见

原文如下:

February 19, 2012

Debian ships with OpenJDK by default, but the Sun (now Oracle) Java SDK could be optionally installed using the package sun-java6-jdk. However, Debian have recently removed Oracle Java from their testing (Wheezy) repositories as a result of a new redistribution license (see ), and so it is not possible to install Oracle Java SDK without a little more work.

I really like OpenJDK, but there are several reasons to install the Oracle tools. Clients will tend to use Oracle Java, so that is what I need to test. I also need to test across a number of versions (1.5, 1.6 and 1.7), and also 32-bit and 64-bit architecture.

I have put together this guide which describes all of the stages to successfully install Oracle Java SE SDK on Debian Wheezy. This guide assumes 64-bit Java 7, but it should work for 32-bit and earlier versions of the SDK too.

Download

First you need to download the latest Java SE SDK version. Go to the following link and download the file jdk-7u3-linux-x64.tar.gz (there maybe a later update available when you do this).

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

Install

Once the download has completed extract it into the /opt directory. To do this open a new root terminal and run the following commands:

# cd /opt
# tar -xzvf <path_to_download>/jdk-7u3-linux-x64.tar.gz
Debian already has a pattern for managing different software versions on the same system. This step registers the downloaded version of Java as an alternative, and switches it to be used as the default:
# update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_03/bin/java 1
# update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_03/bin/javac 1
# update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_03/jre/lib/amd64/libnpjp2.so 1
# update-alternatives --set java /opt/jdk1.7.0_03/bin/java
# update-alternatives --set javac /opt/jdk1.7.0_03/bin/javac
# update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_03/jre/lib/amd64/libnpjp2.so
That’s it!

Test

To see which version of Java you are now running by default, execute the following command from a terminal:

# java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)
To check the browser plugin browse to http://www.java.com/ and click “Do I have Java?”. If everything is installed correctly then you should see the following message:

转载于:https://www.cnblogs.com/ibgo/archive/2013/05/23/3095648.html

你可能感兴趣的文章
使用native 查询时,对特殊字符的处理。
查看>>
maclean liu的oracle学习经历--长篇连载
查看>>
ECSHOP调用指定分类的文章列表
查看>>
分享:动态库的链接和链接选项-L,-rpath-link,-rpath
查看>>
Javascript一些小细节
查看>>
禁用ViewState
查看>>
Android图片压缩(质量压缩和尺寸压缩)
查看>>
nilfs (a continuent snapshot file system) used with PostgreSQL
查看>>
【SICP练习】150 练习4.6
查看>>
HTTP缓存应用
查看>>
KubeEdge向左,K3S向右
查看>>
DTCC2013:基于网络监听数据库安全审计
查看>>
CCNA考试要点大搜集(二)
查看>>
ajax查询数据库时数据无法更新的问题
查看>>
Kickstart 无人职守安装,终于搞定了。
查看>>
linux开源万岁
查看>>
linux/CentOS6忘记root密码解决办法
查看>>
25个常用的Linux iptables规则
查看>>
集中管理系统--puppet
查看>>
分布式事务最终一致性常用方案
查看>>