Install jdk in linux

Source: Internet
Author: User
The first download was the. rpm. bin version, which always showed a dependency check failure during installation. Later, the. bin version was directly downloaded and the installation was successful. I downloaded the jdk1.6.0 _ 16 version, first use the following command to give. binfile execution right: chmod + xjdk-6u16-dlj-lin...

The first download was the. rpm. bin version, which always showed a dependency check failure during installation. Later, the. bin version was directly downloaded and the installation was successful.

I downloaded JDK 1.6.0 _ 16. First, use the following command to grant the. binfile execution right:
Chmod + x jdk-6u16-dlj-linux-i586.bin

Then install with a./jdk-6u16-dlj-linux-i586.bin;

After installing the file, you must set the environment variable.
Vi/etc/profile
Add the following variables to the file:
Export JAVA_HOME =/usr/java/jdk1.6.0 _ 16
Export PATH = $ PATH: $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin
Export CLASSPATH =.: $ JAVA_HOME/lib: $ JAVA_HOME/jre/lib: $ CLASSPATH
Replace/usr/java/jdk1.6.0 _ 16 with the actual installation address.
Restart linux and enter java-version to view the version. If no problem occurs, the installation is complete.
If you encounter
Error occurred during initialization of VM
Java/lang/NoClassDefFoundError: java/lang/Object
Check whether there are unpack rt. pack or tools. pack files in the lib and jre/lib folders.
Run the unpack200 rt. pack rt. jar command to decompress the package.

Author: "FLYINGMAN"
 

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.