Ubuntu 14 Configuration JDK

Source: Internet
Author: User
Tags bz2

1. Download the JDK

Http://www.oracle.com/technetwork/cn/java/javase/downloads/index.html

Save address after download:/home/root1/downloads/jdk-8u20-linux-x64.tar.gz

2. Unzip the file,

/home/root1/downloads/jdk-8u20-linux-x64.tar.gz
The zipzip is probably the most used document compression format today. Its greatest advantage is in the use of different operating system platforms, such as Linux, Windows and Mac OS. The downside is that the compression ratios are not very high, and tar.gz and TAR.GZ2 are doing very well in terms of compression. Gossip less, let's get to the point: we can use the following command to compress a directory: # zip-r Archive_name.zip directory_to_compress The following is if you unzip a zip document: # unzip Archive_ Name.ziptartar is a very extensive document packaging format used in Linux. The advantage is that it consumes very little CPU and time to package files, he is just a packaging tool, not responsible for compression. Here's how to package a directory: # TAR-CVF Archive_name.tar directory_to_compress How to unpack: # TAR-XVF Archive_ name.tar.gz above this unpacking command will unlock the document under the current directory. Of course, you can also use this command to squeeze the path of unpacking: # TAR-XVF archive_name.tar-c/tmp/extract_here/tar. GZ This format is the compression format that I use most. It does not take up too much CPU when compressing, and it can get a very ideal compression rate. Use this format to compress a directory: # TAR-ZCVF archive_name.tar.gz directory_to_compress extract: # TAR-ZXVF Archive_ name.tar.gz above this unpacking command will unlock the document under the current directory. Of course, you can also use this command to squeeze the path of unpacking: # TAR-ZXVF archive_name.tar.gz-c/tmp/extract_here/tar. BZ2 This compression format is the best compression rate in all of the ways we mentioned. This, of course, means that it consumes more CPU and time than the previous way. This is how you use tar.bz2 for compression. # TAR-JCVF archive_name.tar.bz2 directory_to_compress The above unpacking command will unlock the document under the current directory. Of course, you can also use this command to squeeze the path of unpacking: # TAR-JXVF Archive_name.tar.bz2-c/tmp/extract_here/

3. Place the extracted folder in a location that you want to save, similar to Windows program and files, but Linux requires you to choose the path yourself, copy the files in the past, of course, can also be installed directly, if there is an installation package. After I download the address:/home/root1/downloads/jdk-8u20-linux-x64.tar.gz
, put it in the/USR/LIB/JVM path

4. Add Ubuntu Environment variables

  

Add the following code:

Export java_home=/usr/lib/jvm/jdk-8u20-linux-x64

Export JRE_HOME=${JAVA_HOME}/JRE

Export Classpath=.:${java_home}/lib:${jre_home}/lib

Export Path=${java_home}/bin: $PATH

To any one of the 2 files

 1)/etc/profile setting method is valid for all login users

$sudo Gedit/etc/profile

Or

2) ~/.BASHRC only valid for current user

$sudo gedit ~/.BASHRC

5. Making the changes effective

SOURCE ~/.profile

Or

SOURCE ~/.BASHRC

6. Test the JDK

Command: Java-version

Reference:

1. http://jingyan.baidu.com/article/c33e3f48a3365dea15cbb5c9.html

and

2. http://www.linuxidc.com/Linux/2014-11/109216.htm

Ubuntu 14 Configuration JDK

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.