Install JDK in linux and JDK in linux

Source: Internet
Author: User

Install JDK in linux and JDK in linux
Download the corresponding system JDK, which is generally at the end of .tar.gz;

1.1 install Dependencies
Yum install glibc. i686
Yum-y install libaio. so.1 libgcc_s.so.1 libstdc ++. so.6
Yum update libstdc ++-4.4.7-4. el6.x86 _ 64
Yum install gcc-c ++
1.2 check whether jdk software has been installed before the system. If jdk software has been installed, uninstall it.
Rpm-qa | grep-I jdk
Description of parameters: q indicates that query a indicates all | MPs queue I indicates that the jdk program name is case-insensitive.
Rpm-e -- nodeps program name
Description of parameters: the E-generation table eraser. Deleting nodeps indicates deleting other dependent packages.
1.3 install jdk
1.3.1 create an installation directory
Mkdir-p/usr/local/jdk
Parameter description: p indicates recursive Directory Creation and parents. Here, it can be interpreted:
To create the jdk file, if/usr/local exists, it is not created, but it does not exist.
1.3.2 upload the JDK installation package
Create a folder to store the software to be installed.
You can use mkdir-p/usr/software.
1.3.3 Extract
Tar-zxvf program file name-C/usr/local/jdk
Parameter description: z: Decompress. gzip at the end of the attribute, x: decompress, v: Display process, f: this parameter must be the last parameter, followed by the file name to be decompressed.
1.3.4 configure Environment Variables
Add the following information at the end of vim/etc/profile:
Export JAVA_HOME =/usr/local/java/jdk1.7.0 _ 80
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export PATH = $ JAVA_HOME/bin: $ PATH
1.3.5 reload the environment variable configuration file
Source/etc/profile
1.3.6 test whether java-version is successful

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.