Linux JDK eclipse

Source: Internet
Author: User
Http://blog.chinaunix.net/u/21684/showart_384208.html

1. Manually install JDK 6

First, download the http://java.sun.com in the jdk-6u12-linux-i586.bin, it is said that this operation is relatively simple, do not need to switch.
Then, you can place it in any folder you like. If you are a cainiao like me, it is recommended to put it under the main folder (/home.
Install JDK as follows:

Enter your jdk-6u12-linux-i586.bin under the terminal, for example, my location is:/home/liangshihong
Change the File Permission to Executable
$ Sudo chmod U + x jdk-6u12-linux-i586.bin

$ Sudo-S./jdk-6u12-linux-i586.bin
Press enter until you are asked whether to install it. Enter yes and press Enter.

OK. After the installation is complete, configure the environment variables below.

Configure classpath and modify the environment variables of all users
$ Sudo gedit/etc/profile
Add at the end of the file

# Set Java environment

Java_home =/home/liangshihong/jdk1.6.0 _ 12

Export jre_home =/home/liangshihong/jdk1.6.0 _ 12/JRE

Export classpath =.: $ java_home/lib: $ jre_home/lib: $ classpath

Export Path = $ java_home/bin: $ jre_home/bin: $ path

Restart the computer and run the command to test the JDK version.

Java-version

The following information is displayed: the installation is successful.

Java version "1.6.0 _ 12"
Java (TM) se Runtime Environment (build 1.6.0 _ 12-b04)
Java hotspot (TM) server VM (build 11.2-b01, mixed mode)

2. Solution to the error:

After JDK is installed, this error occurs after environment variables are set:

[Root @ localhost lib] # javac
Error occurred during initialization of VM
Java/lang/noclassdeffounderror: Java/lang/Object
[Root @ localhost lib] # Java
Error occurred during initialization of VM
Java/lang/noclassdeffounderror: Java/lang/Object Solution: /Opt/jdk1.6.0 _ 15/lib/tools. Pack to convert to tools. Jar /Opt/jdk1.6.0 _ 15/JRE/lib/RT. Pack to Rt. Jar [Root @ localhost lib] # pwd
/Opt/jdk1.6.0 _ 15/lib
[Root @ localhost lib] # unpack200 tools. Pack tools. Jar
[Root @ localhost lib] # ls
Ct. sym htmlconverter. Jar jconsole. Jar orb. IDL tools. Jar tools. Pack. Bak
DT. Jar IR. IDL jexec sa-jdi.jar tools. Pack visualvm [Root @ localhost lib] # pwd
/Opt/jdk1.6.0 _ 15/JRE/lib
[Root @ localhost lib] # unpack200 rt. Pack Rt. Jar
Related Article

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.