This document describes how to build a JAVA environment in Linux.
1. Download JDK, it is recommended to download RPM self-extract format (RPM in self-extracting file, j2sdk-1_4_2_08-linux-i586-rpm.bin ).
2. Execute the download package:
Chmod 755 j2sdk-1_4_2_08-linux-i586-rpm.bin
/J2sdk-1_4_2_08-linux-i586-rpm.bin
There will be a piece of Sun Protocol, several times the Space key, when asked whether to agree, you can press yes.
Note: If you run the unzip command directly to decompress the package, you can obtain an rpm package.
Re-install the rpm package: rpm-ivh j2sdk-1_4_2_08-linux-i586.rpm
3. Set environment variables:
Change/etc/profile to implement
Add the following at the end of the file:
Export JAVA_HOME =/usr/java/j2sdk1.4.2 _ 08
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export PATH = $ PATH: $ JAVA_HOME/bin
Download eclipse-sdk-3.1-linux-gtk.tar.gz and decompress it to/opt.
Compile a script to start eclipse, named eclipse, and saved in the/usr/bin directory:
#! /Bin/bash
Export JAVA_HOME =/usr/java/j2sdk1.4.2 _ 08
Export CLASSPATH =/usr/java/j2sdk1.4.2 _ 08/lib
/Opt/eclipse-vm/usr/java/j2sdk1.4.2 _ 08/bin/java-data/root/workspace &
5. Create a starter on the desktop with the command bash eclipse. You can select the built-in eclipse icon.