Merge pull request #1439 from su-kaiyao/master

完成翻译 20140801 How To Install Java On Ubuntu 14.04.md
This commit is contained in:
joeren 2014-08-03 19:09:48 +08:00
commit b60b892b4c
2 changed files with 78 additions and 78 deletions

View File

@ -1,78 +0,0 @@
[su-kaiyao]翻译中
How To Install Java On Ubuntu 14.04
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/07/Install_Java_Ubuntu_Linux_Mint.jpeg)
Wondering abut **how to install Java on Ubuntu 14.04**? Installing Java is certainly one of the first few [things to do after installing Ubuntu 14.04][1] and it is very easy to do so, in fact.
Many people have aversion to Java. But there are high chances that for one reason or other, you might have to install Java, no matter how much you dislike it. In this quick post, we shall see how to install Java in Ubuntu 14.04 and (perhaps) Linux Mint 17.
### JRE vs OpenJDK vs Oracle JDK ###
Before we go on seeing the process to install Java, lets quickly understand the difference between JRE, OpenJDK and Oracle JDK.
- JRE (Java Runtime Environment) is what you would need normally to run a Java based application. This is all you need if you are not a programmer.
- JDK stands for Java Development Kit and this is what you need to if you have to do some development (read programming) related to Java.
- OpenJDK is Open Source implementation of Java Development Kit while Oracle JDK is the official Oracle version of Java Development Kit. While OpenJDK is sufficient for most of the cases, some programs such [Android Studio][2] suggests to use Oracle JDK to avoid UI/performance issue.
### Check if Java is already installed in Ubuntu ###
Open a terminal and use the following command:
java -version
If you see an output like the one below, it means you dont have Java installed:
The program java can be found in the following packages:
* default-jre
* gcj-4.6-jre-headless
* openjdk-6-jre-headless
* gcj-4.5-jre-headless
* openjdk-7-jre-headless
Try: sudo apt-get install
### Install Java in Ubuntu and Linux Mint ###
Once we have see the difference between various types of Java, lets see how to install them.
#### Install JRE in Ubuntu and Linux Mint ####
Open terminal and use the following command to install JRE:
sudo apt-get install default-jre
#### Install OpneJDK in Ubuntu and Linux Mint ####
In a terminal, use the following command to install OpenJDK Java Development Kit:
sudo apt-get install default-jdk
If you are specifically looking to install Java 7 or Java 6 etc, you can use openjdk-7-jdk/openjdk-6-jdk but remember to install openjdk-7-jre/openjdk-6-jdk before it.
#### Install Oracle JDK in Ubuntu 14.04 and Linux Mint 17 ####
Use the following commands to install Oracle JDK in Ubuntu and Linux Mint. Just a heads up, it will download plenty of files. So make sure you have good internet speed:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
If you want to install Java 7 (i.e. Java 1.7), just replace java8 with java7 in the above commands.
I hope this article helped you to install Java in Ubuntu, Linux Mint and other Linux distributions based on Ubuntu. Any questions or suggestions are always welcomed.
--------------------------------------------------------------------------------
via:
作者:[Abhishek][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/Abhishek/
[1]:http://itsfoss.com/things-to-do-after-installing-ubuntu-14-04/
[2]:http://itsfoss.com/install-android-studio-ubuntu-linux/

View File

@ -0,0 +1,78 @@
怎样在Ubuntu 14.04中安装Java
=====================================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/07/Install_Java_Ubuntu_Linux_Mint.jpeg)
想知道**如何在Ubuntu 14.04中安装Java**安装Java肯定是[安装Ubuntu 14.04后首先要做的几件事情之一](1),而且这也很简单
许多人比较厌恶Java但是很有可能因为某些原因你需要安装Java尽管你很讨厌它。在这篇文章中我们将展示如何在Ubuntu 14.04安装Java也可能在Linux Mint 17同样适用
### JRE vs OpenJDK vs Oracle JDK ###
在我们继续了解如何安装Java之前让我们快速地了解JRE,OpenJDK和Oracle JDK之间的不同之处
- JREJava Runtime Environment它是你运行一个基于Java语言应用程序的所正常需要的环境。如果你不是一个程序员的话这些足够你的需要
- JDK代表Java开发工具包如果你想做一些有关Java的开发阅读程序这正是你所需要的
- OpenJDK是Java开发工具包的开源实现Oracle JDK是Java开发工具包的官方Oracle版本。尽管OpenJDK已经足够满足大多数的案例但是许多程序比如[Android Studio](2)建议使用Oracle JDK以避免UI/性能问题
### 检查Java是否已经安装在Ubuntu上 ###
打开终端,使用下面的命令:
java -version
如果你看到像下面的输出这就意味着你并没有安装过Java:
The program java can be found in the following packages:
* default-jre
* gcj-4.6-jre-headless
* openjdk-6-jre-headless
* gcj-4.5-jre-headless
* openjdk-7-jre-headless
Try: sudo apt-get install
### 在Ubuntu和Linux Mint上安装Java ###
看了各种类型Java的不同之后让我们看如何安装他们
#### 在Ubuntu和Linux Mint上安装JRE ####
打开终端使用下面的命令安装JRE
sudo apt-get install default-jre
#### 在Ubuntu和Linux Mint上安装OpenJDK ####
在终端使用下面的命令安装OpenJDK Java开发工具包
sudo apt-get install default-jdk
特殊地如果你想要安装Java 7或者Java 6等等你可以使用openjdk-7-jdk/openjdk-6jdk但是记住在此之前安装openjdk-7-jre/openjdk-6-jre
#### 在Ubuntu和Linux Mint上安装Oracle JDK ####
使用下面的命令安装,只需一些时间,它就会下载许多的文件,所及你要确保你的网络环境良好:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
如果你想安装Java 7(i.e Java 1.7)在上面的命令中用java7代替java8
我希望这篇文章能够帮助你学会在Ubuntu,Linux Mint和其它基于Ubuntu的Linux发行版本上安装Java我们欢迎所有问题或者建议
------------------------------------------------------------------------------------------------------------------
via:
作者:[Abhishek][a]
译者:[su-kaiyao](https://github.com/su-kaiyao)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/Abhishek/
[1]:http://itsfoss.com/things-to-do-after-installing-ubuntu-14-04/
[2]:http://itsfoss.com/install-android-studio-ubuntu-linux/