Install Eclipse IDE and JDK in RedHat Linux 9.0

Source: Internet
Author: User
Tags gtk

After installing eclipse in redhat9.0 for a long time, I still don't understand it, but I can finally use it:

(1) Software Download
Download: "Eclipse IDE for Java developers, 98 m) --- Linux 32bit ".
Download: "Java SE development kit6 update 25, in which select" Linux x86-RPM installer, 76.85 MB, jdk-6u25-linux-i586-rpm.bin "".
Eclipse download page: http://www.eclipse.org/downloads? Ostype = Linux
JDK download page: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html

 

(2) software installation and environment variable settings
Three software in total:
Eclipse-java-helios-SR2-linux-gtk.tar.gz
Eclipse-cpp-helios-SR2-linux-gtk.tar.gz
Jdk-6u25-linux-i586-rpm.bin
-2.1-Enter the following command in the terminal: "Java-version". The current computer's Java version is displayed, and the local machine is displayed as "1.3.1 ";
-2.2-In the terminal, use the command "cd" to switch to the directory where the package is located, and then enter the command: "./jdk-6u25-linux-i586-rpm.bin ".
The Installation Process of the software will be displayed on the terminal, and prompts which files are installed, and seven RPM files mentioned in the terminal are generated under the current directory.
-2.3-Enter the command "Java-version" in the terminal to display the current Java version on the computer. The local display is still "1.3.1 "; (indicates that the latest JDK version is not used.

If the eclipse for Java software is installed at this time, there are no errors during the installation process, but after the installation is complete, eclipse cannot run, and an error prompt dialog box is displayed, the second line shows "require Java version 1.5 ". it can be seen that eclipse runs normally only when the system uses the newly installed JDK .)
-2.4-After searching on the internet, you find that you need to set some environment variables. The following methods are used to modify "/etc/profile:
-2.4.1-From the csdn community-Java-Jave SE:
Add

Enter the following content:
Java_home =/soft/SDK/JDK
Classpath =.: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Path = $ path: $ java_home/bin
Export path

Java_home classpath
-2.4.2-From C ++ blog: Add the following content to the end of the file
Path = $ path:/usr/Java/jre1. 5. 0_09/bin
Export java_home =/

Usr/Java/jre1. 5. 0_09
Export classpath = $ java_home/lib :.
After trying the first method, enter the "set" command in the terminal to view the environment variable after the setting,

At the same time, there is such a sentence:

"Path =/usr/Kerberos/sbin:/usr/Kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin: /usr/sbin:/usr/bin:/usr/x11r6/bin:/usr/J

Ava/jdk1.6.0 _ 25/bin:/root/bin ".
Check again the Java version, which is still "1.3.1 ".
After trying the second method, enter the "set" command in the terminal, and you will not be able to see the set environment variable. At the same time, there is such a sentence:

"Path =/usr/Kerberos/sbin:/usr/Kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin: /usr/sbin:/usr/bin:/usr/x11r6/bin:/root/bin ".
Check again the Java version, which is still "1.3.1 ".
After each modification, the computer is restarted.
-2.5-Open the "etc/profile" file again and find the following statements:
If ['id-U' = 0]; then
Pathmunge/sbin
Pathmunge/usr/sbin
Pathmunge/usr/local/sbin
Fi
At the same time, I think there is such a sentence in the terminal:

"Path =/usr/Kerberos/sbin:/usr/Kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin: /usr/sbin:/usr/bin:/usr/x11r6/bin:/root/bin. "It seems to indicate the priority order of the binfile used by the system, so I decided to modify this sentence.
On my computer, the JDK installation path is "/usr/Java/jdk1.6.0 _ 25". Therefore, add the following sentence:
If ['id-U' = 0]; then
Pathmunge/sbin
Pathmunge/usr/Java/jdk1.6.0 _ 25/bin # added
Pathmunge/usr/sbin
Pathmunge/usr/local/sbin
Fi
After saving, restart the computer and check the Java version again. The displayed version is: Java version "1.6.0 _ 25 ". (If eclipse for Java has been installed and runs again, the software starts normally .) I don't know if this will leave potential troubles for future development.

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.