在Ubuntu12.10系统安装JDK7

本文介绍了一种在Ubuntu系统中简单安装Oracle JDK 7的方法,通过添加PPA源并利用自动化脚本实现一键安装,同时支持自动更新。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

        最近突然想安装一个ubuntu系统来玩玩,想用来开发android游戏,但是安装一个JDK就折腾了我不少时间,官网下载没有DEB格式的安装文件,我又不会编译,痛苦,网上找到一篇文章自动安装的,在这转载下,虽然是英文版的。

        转自http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html

       

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).

nstall 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
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



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!

资源下载链接为: https://pan.quark.cn/s/22ca96b7bd39 在当今的软件开发领域,自动化构建与发布是提升开发效率和项目质量的关键环节。Jenkins Pipeline作为一种强大的自动化工具,能够有效助力Java项目的快速构建、测试及部署。本文将详细介绍如何利用Jenkins Pipeline实现Java项目的自动化构建与发布。 Jenkins Pipeline简介 Jenkins Pipeline是运行在Jenkins上的一套工作流框架,它将原本分散在单个或多个节点上独立运行的任务串联起来,实现复杂流程的编排与可视化。它是Jenkins 2.X的核心特性之一,推动了Jenkins从持续集成(CI)向持续交付(CD)及DevOps的转变。 创建Pipeline项目 要使用Jenkins Pipeline自动化构建发布Java项目,首先需要创建Pipeline项目。具体步骤如下: 登录Jenkins,点击“新建项”,选择“Pipeline”。 输入项目名称和描述,点击“确定”。 在Pipeline脚本中定义项目字典、发版脚本和预发布脚本。 编写Pipeline脚本 Pipeline脚本是Jenkins Pipeline的核心,用于定义自动化构建和发布的流程。以下是一个简单的Pipeline脚本示例: 在上述脚本中,定义了四个阶段:Checkout、Build、Push package和Deploy/Rollback。每个阶段都可以根据实际需求进行配置和调整。 通过Jenkins Pipeline自动化构建发布Java项目,可以显著提升开发效率和项目质量。借助Pipeline,我们能够轻松实现自动化构建、测试和部署,从而提高项目的整体质量和可靠性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值