1. Download JDK: java.sun.com/j2se/1.4.2/download.html "> http://java.sun.com/j2se/1.4.2/download.html, my computer is 64-bit, so download jdk-7u25-linux-x64.rpm
2. Install JDK:
# Rpm-ivh jdk-7u25-linux-x64.rpm
If the prompt is displayed:
Rpm: RPM shocould not be used directly install RPM packages, use Alien instead!
Rpm: However assuming you know what you are doing...
Error: dependency detection failed:
/Bin/basename is jdk-2000: 1.7.0 _ 25-fcs.x86_64 required
/Bin/cat jdk-2000: 1.7.0 _ 25-fcs.x86_64 required
/Bin/cp is jdk-2000: 1.7.0 _ 25-fcs.x86_64 need
/Bin/gawk jdk-2000: 1.7.0 _ 25-fcs.x86_64 required
/Bin/grep jdk-2000: 1.7.0 _ 25-fcs.x86_64 required
/Bin/ln jdk-2000: 1.7.0 _ 25-fcs.x86_64 required
/Bin/ls is jdk-2000: 1.7.0 _ 25-fcs.x86_64 need
/Bin/mkdir is jdk-2000: 1.7.0 _ 25-fcs.x86_64 need
/Bin/mv jdk-2000: 1.7.0 _ 25-fcs.x86_64 required
/Bin/pwd is jdk-2000: 1.7.0 _ 25-fcs.x86_64 need
/Bin/rm is jdk-2000: 1.7.0 _ 25-fcs.x86_64 required
/Bin/sed is jdk-2000: 1.7.0 _ 25-fcs.x86_64 need
/Bin/sort is jdk-2000: 1.7.0 _ 25-fcs.x86_64 need
/Bin/touch jdk-2000: 1.7.0 _ 25-fcs.x86_64 required
/Usr/bin/cut is jdk-2000: 1.7.0 _ 25-fcs.x86_64 required
/Usr/bin/dirname is jdk-2000: 1.7.0 _ 25-fcs.x86_64 need
/Usr/bin/expr jdk-2000: 1.7.0 _ 25-fcs.x86_64 required
/Usr/bin/find jdk-2000: 1.7.0 _ 25-fcs.x86_64 required
/Usr/bin/tail jdk-2000: 1.7.0 _ 25-fcs.x86_64 required
/Usr/bin/tr jdk-2000: 1.7.0 _ 25-fcs.x86_64 required
/Usr/bin/wc jdk-2000: 1.7.0 _ 25-fcs.x86_64 required
/Bin/sh is jdk-2000: 1.7.0 _ 25-fcs.x86_64 need
Then
# Sudo apt-get install rpm
# Sudo apt-get install alien
# Sudo rpm-ivh jdk-7u25-linux-x64.rpm -- nodeps -- force
The following message is displayed:
Preparing... ################################# [100%]
Upgrading/installing...
1: jdk-2000: 1.7.0 _ 25-fcs ################################# [100%]
Unpacking JAR files...
Rt. jar...
Jsse. jar...
Charsets. jar...
Tools. jar...
Localedata. jar...
/Var/tmp/rpm-tmp.MA2DTM: 649: [:/usr/java/jdk1.7.0 _ 25: unexpected operator
/Var/tmp/rpm-tmp.MA2DTM: 650: [:/usr/java/jdk1.7.0 _ 25: unexpected operator
Good. JDK is successfully installed.
3. Configure Environment Variables
The environment variables set in this way will take effect for the user's shell.
You can first check jdk version: # cd/usr/java to get jdk 1.7.0 _ 25
# Sudo gedit/etc/profile
Add the following at the end of the/etc/profile file:
Export JAVA_HOME =/usr/java/jdk1.7.0 _ 25
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export PATH = $ PATH: $ JAVA_HOME/bin
Then # source/etc/profile (restart to make it take effect)
4. After JDK is installed successfully, install eclipse: www.eclipse.orgto download eclipse-standard-kepler-r-linux-gtk-x86_64.tar.gz.
5. decompress the package to the/opt directory:
# Cd/opt
# Sudo tar-xzvf/home/zqy/download/eclipse-standard-kepler-R-linux-gtk-x86_64.tar.gz
# Cd eclipse
#./Eclipse
Start eclipse.