(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
- 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.
- 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.
- 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.
- 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:
[email protected]:~$ java 用法: java [-options] class [args...] (执行类) 或 java [-options] -jar jarfile [args...] (执行 jar 文件) ......................
比较简单。