Linux installation JDK

Source: Internet
Author: User
Tags bz2 rar

Blog: http://www.cnblogs.com/wuqianling/p/5381895.html

JDK: Direct Internet download and decompression version can also be downloaded from the official website; jdk-7u79-linux-x64.tar.gz

installation version :

[[email protected] ~]# cd/mnt/hgfs/share///       Enter the shared directory [[email protected] share]# ls-l                 //view total files in directory 70117-rwxrwxr WX 1 root root 71799552 04-12 11:14 jdk-6u45-linux-i586.bin    //This is the JDK file [[email protected] share]# MKDIR/USR/JAVA/
   //Create a new Java directory under the/usr directory [[email protected] share]# CP jdk-6u45-linux-i586.bin/usr/java/          //Copy the JDK file into the/usr/java/directory [[Email protected] share]#[[email protected] share]# cd/usr/java/         //Enter the Java directory [[email protected] java]# ls-l                  //Check Look at the files in the directory total 70196-rwxr-xr-x 1 root root 71799552 04-12 11:32 jdk-6u45-linux-i586.bin    //The JDK files have been copied into the Java directory [email Protected] java]#
[[email protected] java]#./jdk-6u45-linux-i586.bin        // install JDK
[[email protected] java]# ls-702008 root root     2013-03-//04-all:32 jdk-6u45-linux-         

Decompression version of the direct configuration environment Variables

[[email protected] java]# vi/etc/profile      //edit after opening with VI

Add the following environment variable at the end of the/etc/profile file: (My JDK directory above is jdk1.6.0_45, so this is also the java_home below)
Export JAVA_HOME=/USR/JAVA/JDK1. 6. 0_45export path= $JAVA _home/bin: $PATHexport classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/ Tools.jar  

2, let/etc/profile file changes immediately after the effective, there are two ways:

Method 1:
To make the/etc/profile file effective immediately after modification, you can use the following command:
# . /etc/profile
Attention:. There are spaces between the/etc/profile and the

Method 2:
To make the/etc/profile file effective immediately after modification, you can use the following command:
# Source/etc/profile

Note: You can try restarting the system if it still does not take effect

4. Testing

[[Email protected] java]# java
[Email protected] java]# Javac

[[email protected] java]# Java-versionjava version "1.6.0_45" Java (TM) SE Runtime Environment (build 1.6.0_45-b06) Java Hot Spot (TM) Client VM (build 20.45-b01, mixed mode, sharing)

Note: The Linux installation jdk and win are basically the same;

Blog: http://blog.csdn.net/mmllkkjj/article/details/6768294/

Tar
-C: Create compressed archives
-X: Unzip
-T: View content
-r: Append files to the end of a compressed archive file
-U: Update files in original compressed package

These five are stand-alone commands, which use one of the compression decompression, and can be used with other commands but only one. The following parameters are optional when compressing or extracting files as needed.

-Z: With gzip properties
-j: With the bz2 attribute
-Z: With the Compress attribute
-V: Show All procedures
-O: Unpack the file to standard output

The following parameter-F is required

-F: Use the file name, remember that this parameter is the last parameter, can only be followed by the file name.

# TAR-CF All.tar *.jpg
This command is to make all. jpg files into a package called All.tar. -C is the file name that represents the generation of a new package,-f specifies the package.

# tar-rf All.tar *.gif
This command adds all the. gif files to the All.tar package. -R is meant to increase the file.

# tar-uf all.tar logo.gif
This command updates the logo.gif file in the original tar package All.tar, and-u means the update file.

# TAR-TF All.tar
This command is to list all files in the All.tar package,-T is the meaning of the list of files

# tar-xf All.tar
This command is to solve all the files in the All.tar package, and-X is the meaning of the undo

Compression
TAR–CVF Jpg.tar *.jpg//package all JPG files in the directory into tar.jpg
TAR–CZF jpg.tar.gz *.jpg//pack all JPG files in the directory into Jpg.tar and compress them in gzip to generate a gzip compressed package named jpg.tar.gz
TAR–CJF jpg.tar.bz2 *.jpg//pack all JPG files in the directory into Jpg.tar and compress them in bzip2 to generate a bzip2 compressed package named jpg.tar.bz2
TAR–CZF jpg.tar.z *.jpg//pack all JPG files in the directory into Jpg.tar and compress them in compress to generate a umcompress compressed package named Jpg.tar.z
RAR a jpg.rar *.jpg//rar format compression, you need to download rar for Linux first
Zip jpg.zip *.jpg//zip format compression, need to download zip for Linux First

Extract
TAR–XVF File.tar//Unpacking the TAR Package
TAR-XZVF file.tar.gz//Decompression tar.gz
TAR-XJVF file.tar.bz2//Decompression tar.bz2
TAR–XZVF file.tar.z//Unzip tar. Z
Unrar e file.rar//decompression rar
Unzip File.zip//Unzip zip

Summarize
1, *.tar with TAR–XVF decompression
2, *.gz with gzip-d or gunzip decompression
3, *.tar.gz and *.tgz with TAR–XZF decompression
4, *.bz2 with bzip2-d or with BUNZIP2 decompression

5, *.tar.bz2 with TAR–XJF decompression
6, *. Z Extract with Uncompress
7, *.tar. Z Extract with Tar–xzf
8, *.rar with Unrar e decompression
9, *.zip with unzip decompression

Vi

W:write, writing

Q:quit, exit

Linux installation 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.