install oracle java 7 in ubuntu via ppa

We've previously written about installing Oracle JDK 7 in Ubuntu using a script with a GUI provided by Zenity. Some may find this method hard to use and also, it comes with GTK dependencies. So as an alternative that doesn't have any GTK dependencies and comes with automatic updates too, I've set up an Ubuntu PPA for the latest Oracle Java 7 (JDK).

If you really need to use Oracle (ex Sun) Java instead of OpenJDK in Ubuntu, here's an easy way to do it:  a PPA repository to install and keep your computer up to date with the latest Oracle Java 7 (Java JDK which includes JRE).

Oracle JDK7 itself is not hosted in the PPA because that's not allowed by the new Java license (which is also the reason why it has been removed from the official Ubuntu repositories);  the package in the PPA automatically downloads (and installs) Oracle Java JDK 7 from its official website and installs it on your computer, just like the flashplugin-installer package does.


Please note that this package is currently in alpha and is offered without any guarantees, so it may or may not work! Use it at your own risk! The package should support proxies just like the flashplugin-installer does, but it may fail if your ISP or router blocks some non-standard ports because Oracle uses quite a few redirects for the Java 7 binary download links. If the download fails because of blocked ports or because you're behind a firewall, use the manual Oracle Java 7 installation method (link in the beginning of the post).


Install Oracle Java 7 in Ubuntu via PPA


This package provides Oracle Java JDK 7 (which includes Java JDK, JRE and the Java browser plugin). However, you can't only install Oracle JRE - the PPA only provides the full Oracle JDK7 package.


To add our PPA and install the latest Oracle Java 7 in Ubuntu (supports Ubuntu 13.04, 12.10, 12.04, 11.10, 11.04 and 10.04), use the commands below:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

After the installation finishes, if you wish to see if it was successful, you can run the following command:
java -version
It should return something like this:
java version "1.7.0_10"
Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

The package installs all the Java binaries, so you can also try "javac -version" which should return "javac 1.7.0_10" and so on (the "_10" part of the version can be different because I'm constantly updating the PPA with the latest Oracle Java 7 version).  The current JDK version in the PPA is Oracle Java 7 Update 10 (7u10).

If for some reason, the Java version in use is not 1.7.0, you can try to run the following command:
sudo update-java-alternatives -s java-7-oracle

Update:  the Oracle Java 7 (JDK & JRE) PPA is now available for Ubuntu 12.10 Quantal Quetzal and  13.04 Raring Ringtail.

Update 2: the installer now requires you accept the Oracle license before the installation begins. This is only required once. If for some reason you need the installation to be automated, you can run the following command to automatically accept the Oracle license:
sudo echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections


Setting Java environment variables


To automatically set up the Java 7 environment variables, you can install the following package:
sudo apt-get install oracle-java7-set-default

If you've already installed  oracle-java6-set-default or  oracle-java8-set-default, they will be automatically removed when installing  oracle-java7-set-default (and the environment variables will be set for Oracle Java 7 instead).


Removing Oracle Java 7


If you don't want to use Oracle Java (JDK) 7 anymore and want to go back to OpenJDK, all you have to do is remove the Oracle JDK7 Installer and the previous Java (OpenJDK, etc.) version will be used:
sudo apt-get remove oracle-java7-installer

Update:  for Debian, see:  How To Install Oracle Java 7 In Debian Via Repository

The package is based on Bruce Ingalls' Java Update script and on the flashplugin-installer debian package - thanks!


基于bert实现关系三元组抽取python源码+数据集+项目说明.zip基于bert实现关系三元组抽取python源码+数据集+项目说明.zip基于bert实现关系三元组抽取python源码+数据集+项目说明.zip基于bert实现关系三元组抽取python源码+数据集+项目说明.zip基于bert实现关系三元组抽取python源码+数据集+项目说明.zip 个人大四的毕业设计、课程设计、作业、经导师指导并认可通过的高分设计项目,评审平均分达96.5分。主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者,也可作为课程设计、期末大作业。 [资源说明] 不懂运行,下载完可以私聊问,可远程教学 该资源内项目源码是个人的毕设或者课设、作业,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96.5分,放心下载使用! 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),供学习参考。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值