码迷,mamicode.com
首页 > 系统相关 > 详细

Ubuntu 14.04 jdk安装与配置

时间:2016-01-19 01:49:52      阅读:267      评论:0      收藏:0      [点我收藏+]

标签:jdk   bashrc   环境变量配置   java   

(1)jdk安装

    需要在ubuntu下使用Pycharm,但是Pycharm是用Java写的,所以必须安装jdk。安装的方法很多,上官网找了适合Ubuntu的,给出下面的文档:

============================================

Installation of the 64-bit JDK on Linux Platforms

This procedure installs the Java Development Kit (JDK) for 64-bit Linux, using an archive binary file (.tar.gz).

These instructions use the following file:

jdk-8uversion-linux-x64.tar.gz
  1. Download the file.

    Before the file can be downloaded, you must accept the license agreement. The archive binary can be installed by anyone (not only root users), in any location that you can write to. However, only the root user can install the JDK into the system location.

  2. Change directory to the location where you would like the JDK to be installed, then move the .tar.gz archive binary to the current directory.

  3. Unpack the tarball and install the JDK.

    % tar zxvf jdk-8uversion-linux-x64.tar.gz

    The Java Development Kit files are installed in a directory called jdk1.8.0_version in the current directory.

  4. Delete the .tar.gz file if you want to save disk space.

============================================

    显然有时候你会发现自己看官方的英文文档要比上网去找教程好,网上的教程虽多,但有时候也杂乱,所以这时候还不如找官方的文档看。链接可以看这里:http://docs.oracle.com/javase/8/docs/technotes/guides/install/linux_jdk.html

    完了之后,选择把jdk解压在/usr/lib/java目录中,安装即完成。


(2)配置环境变量

    执行下面的命令:

echo "PATH=$PATH:/usr/lib/java/jdk1.8.0_65/bin" >> ~./bashrc

    使配置生效:

source ~./bashrc

    输入java:

xpleaf@leaf:~$ java
用法: java [-options] class [args...]
           (执行类)
   或  java [-options] -jar jarfile [args...]
           (执行 jar 文件)
......................

    

    比较简单。

本文出自 “香飘叶子” 博客,请务必保留此出处http://xpleaf.blog.51cto.com/9315560/1736303

Ubuntu 14.04 jdk安装与配置

标签:jdk   bashrc   环境变量配置   java   

原文地址:http://xpleaf.blog.51cto.com/9315560/1736303

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!