The following uses the Ubuntu10.04 (64bit) system as an example: 1. Install JDK. 1 $ sudoapt-getinstallsun-java5-jdk Note: if the sun-java-jdk package cannot be found by executing the above command, add the following source to the file/etc/apt/sources. list. {Debhttp: // cz.archive.ubuntu.com/ubuntuhardy-updatesma
The following uses Ubuntu 10.04 (64bit) as an example:
1. Install JDK.
1 $ sudo apt-get install sun-java5-jdk
Note: If you cannot find the sun-java-jdk package by running the preceding command, add the following source to the file/etc/apt/sources. list.
{{
Deb http://cz.archive.ubuntu.com/ubuntu hard-updates main multiverse
} Run: $ sudo apt-get update to update the source and then execute the above command.
2. Add Environment Variables
Add the following to/etc/environment:
CLASSPATH =/usr/lib/jvm/java-1.5.0-sun/bin
JAVA_HOME =/usr/lib/jvm/java-1.5.0-sun
Or
Add in file/etc/profile
JAVA_HOME =/usr/lib/jvm/java-1.5.0-sun
Export CLASSPATH =.: $ JAVA_HOME/lib: $ CLASSPATH
Export PATH = $ JAVA_HOME/bin: $ PATH
If CLASSPATH and JAVA_HOME are already set, modify them to the preceding format and save and exit. Www.linuxidc.com
Ii. Install the packages required for the compiling environment:
$ Sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl sun-java5-jdk zlib1g-dev gcc-multilib g ++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev
3. Set the system's default jdk to 1.5:
$ Sudo update-java-alternatives-s java-1.5.0-sun
4. If Ubuntu does not have an X11 library, run the following command:
$ Sudo ln-s/usr/lib32/libX11.so. 6/usr/lib32/libX11.so
5. Ubuntu uses dash by default, but the dash function is weak, so change it to bash. Run the following command:
$ Sudo ln-snf/bin/bash/bin/sh
This is a success.