Ubuntu 14.04 jdk安装与配置

(1)安装

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

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

Installation of the 64-bit on Platforms

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

These instructions use the following file:

-8uversion--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.

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

显然有时候你会发现自己看官方的英文文档要比上网去找教程好,网上的教程虽多,但有时候也杂乱,所以这时候还不如找官方的文档看。链接可以看这里:

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

(2)配置环境变量

执行下面的命令:

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

使配置生效:

1
source ~./bashrc

输入java:

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

比较简单。

(3)更好的安装与配置方法

当然前面的都要自己去动手,如果你觉得还是太麻烦了,那就采用在线的方式吧。这样做还有一个好处,那就是不用你自己手动配置。

    1.首先更新软件源

sudo apt-get update

如果更新软件源的时候总是出现,你可以考虑更改软件源,只需要把/etc/source.list中的内容修改就可以了,至于哪个更新源比较好,看你所在的网络环境。自己可以百度去找一些,建议用国内的。

2.安装jdk

    sudo apt-get install openjdk-8-jre

如果提示说没有这个软件,那就说明是软件源的,把软件源改掉吧。

3.输入java

输入java发现就有提示了,说明配置都已经帮我们做好了。

Ubuntu 14.04安装JDK1.8.0_25与配置环境变量  

 

Ubuntu 14.04安装JDK1.8.0_25与配置环境变量   

Ubuntu 14.04 LTS安装 

CentOS6.3安装JDK和环境配置  

Ubuntu 14.04 安装 JDK8   

Ubuntu下安装JDK图文解析  

更多Ubuntu相关信息见

转载自:https://www.linuxidc.com/Linux/2016-02/128120.htm

声明: 除非转自他站(如有侵权,请联系处理)外,本文采用 BY-NC-SA 协议进行授权 | 智乐兔
转载请注明:转自《Ubuntu 14.04 jdk安装与配置
本文地址:https://www.zhiletu.com/archives-5845.html
关注公众号:智乐兔

赞赏

wechat pay微信赞赏alipay pay支付宝赞赏

上一篇
下一篇

相关文章

在线留言

你必须 登录后 才能留言!

在线客服
在线客服 X

售前: 点击这里给我发消息
售后: 点击这里给我发消息

智乐兔官微