Merge pull request #837 from runningwater/master

翻译完成
This commit is contained in:
Vito 2014-03-30 01:47:29 +08:00
commit 11d9cdaf71
2 changed files with 63 additions and 64 deletions

View File

@ -1,64 +0,0 @@
(translating by runningwater)
Daily Ubuntu Tips Manually Install Oracle Java JDK 8 In Ubuntu
================================================================================
This brief tutorial is going to show you how to manually install Oracle Java JDK 8, which was just recently released in Ubuntu. This method will show you how to download the package from its download page and install it in Ubuntu without using external PPAs or third party sources.
This method doesnt depend on third-party repository. You download it directly from Oracles download page and install in Ubuntu.
JDK 8 is a major release and the latest which features a new language called Lambda Expressions “enables you to treat functionality as a method argument, or code as date”
Also released with this version are collection of classes in the new java.util.stream package that provide a Stream API to support functional-style operations.
For more about this release, please visit the release page @ [http://www.oracle.com/technetwork/java/javase/8-whats-new-2157071.html][1]
To get started with downloading and installing Java JDK8 in Ubuntu, visit the [download page][2] and get the latest version from there. You can to download the 32-bit or 64-bit version for you Ubuntu machine.
Heres [download page][3]
You must accept the license agreement before downloading.
When you download the file, choose to save it. By default Firefox saves it downloads in the **~/Downloads** folder in Ubuntu.
![oracle-jdk8-ubuntu ](http://www.liberiangeek.net/wp-content/uploads/2014/03/oraclejdk8ubuntu.png)
Next, open the terminal and run the commands below to extract the downloaded file.
tar -xvf ~/Downloads/jdk-8-linux-x64.tar.gz
Then run the commands below to create a folder for Java JDK 8 files in the /usr/lib directory.
sudo mkdir -p /usr/lib/jvm/jdk1.8.0/
Then run the commands below to move JDK content to the new folder.
sudo mv jdk1.8.0/* /usr/lib/jvm/jdk1.8.0/
Next, run the commands below to begin configuring Java
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0/bin/java" 1
Then copy and paste the line below enable Javac module
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0/bin/javac" 1
Finally, copy and paste the commands below to complete the installation.
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.8.0/bin/javaws" 1
To verify if Java is fully installed, run the commands below to test it.
java version
Enjoy!
--------------------------------------------------------------------------------
via: http://www.liberiangeek.net/2014/03/daily-ubuntu-tips-manually-install-oracle-java-jdk-8-in-ubuntu/
译者:[runningwater](https://github.com/runningwater) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.oracle.com/technetwork/java/javase/8-whats-new-2157071.html
[2]:http://www.oracle.com/technetwork/java/javase/downloads/index.html
[3]:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

View File

@ -0,0 +1,63 @@
日常 Ubuntu 小技巧 - 在 Ubuntu 中手工安装 Oracle 的 Java JDK 8
================================================================================
这篇简短的教程将会演示如何在 Ubuntu 系统中安装 Oracle 公司最新发布的 Java JDK 8.这儿使用的方法是教你如何从下载页面下载安装包,然后在 Ubuntu 中安装,并未使用通过从外部的 PPA 或者从第三方源代码的安装方法。
这种方法不需要依赖于第三方的源仓库。你只需要从 Oracle 的官方下载页直接下载,然后安装就行。
JDK 8 是一个重要的发行版本,也加入了最新的叫做 Lambda 表达式的新语言功能,此功能可以“把一个功能函数当作一个方法参数或者代码块当作日期类型”。
这一个版本也发布了一个新的 java.util.stream 包类集合,提供了基于流的 API用来支持函数式操作的功能。
关于此次发布版本的更多信息,请访问它的发布主页 @ [http://www.oracle.com/technetwork/java/javase/8-whats-new-2157071.html][1]
要下载和安装 Java JDK8请访问[下载页][2]获得最新的发行版本。根据你机器的 Ubuntu 系统的情况可以选择下载 32 位或 64 位的发行版本。
这儿是[下载页面][3]
在下载之前,您必须接受许可协议。
下载文件,保存。在 Ubuntu 系统中 Firefox 浏览器会把它下载的东西自动保存到 **~/Downloads** 目录下。
![oracle-jdk8-ubuntu ](http://www.liberiangeek.net/wp-content/uploads/2014/03/oraclejdk8ubuntu.png)
第二步,打开终端运行如下命令来解压下载的文件。
tar -xvf ~/Downloads/jdk-8-linux-x64.tar.gz
然后运行如下的命令,在 /usr/lib 目录中创建一个为保存 Java JDK 8 文件的目录。
sudo mkdir -p /usr/lib/jvm/jdk1.8.0/
接下来运行如下命令把解压的 JDK 文件内容都移动到创建的目录中。
sudo mv jdk1.8.0/* /usr/lib/jvm/jdk1.8.0/
下一步,运行如下命令来配置 Java
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0/bin/java" 1
接下来,拷贝和粘贴下面这一行到终端执行,以启用 Javac 模块。
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0/bin/javac" 1
最后,拷贝和粘贴下面一行到终端以完成最终的安装。
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.8.0/bin/javaws" 1
要验证下 Java 是否已经完全安装的话,可以运行下面的命令来测试。
java version
敬请享受吧!
--------------------------------------------------------------------------------
via: http://www.liberiangeek.net/2014/03/daily-ubuntu-tips-manually-install-oracle-java-jdk-8-in-ubuntu/
译者:[runningwater](https://github.com/runningwater) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.oracle.com/technetwork/java/javase/8-whats-new-2157071.html
[2]:http://www.oracle.com/technetwork/java/javase/downloads/index.html
[3]:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html