I want to install Java1.5 and Java 1.6 on my Ubuntu 8.10. And that's he propose in this topic.
1. update or reload Syn Package Manager
2. install different version Java
So you can install them from Syn Package Manager or commend line as:
3. verify Java installation
4. list all the available Java runtime environments
5. change default java version in Ubuntu
6. setup JAVA_HOME and PATH
setup for all user or Ubuntu in /etc/environment:
add /usr/lib/jvm/java-6-sun/bin in the PATH
for my home ~/.bashrc
all done.
1. update or reload Syn Package Manager
Java 5
The Java 5 packages available is listed as follows:
The Java 5 packages available is listed as follows:
sun-java5-bin | sun-java5-fonts | sun-java5-plugin |
sun-java5-demo | sun-java5-jdk | sun-java5-source |
sun-java5-doc | sun-java5-jre | sun-java5-src |
Java 6
The Java 6 packages available is listed as follows:
The Java 6 packages available is listed as follows:
sun-java6-bin | sun-java6-javadb | sun-java6-plugin |
sun-java6-demo | sun-java6-jdk | sun-java6-source |
sun-java6-doc | sun-java6-jre | sun-java6-src |
sun-java6-fonts | sun-java6-jre-headless |
So you can install them from Syn Package Manager or commend line as:
sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin
3. verify Java installation
java -version
4. list all the available Java runtime environments
update-java-alternatives -l
5. change default java version in Ubuntu
sudo update-java-alternatives -s <JRE Version>
6. setup JAVA_HOME and PATH
setup for all user or Ubuntu in /etc/environment:
JAVA_HOME=/usr/lib/jvm/java-6-sun/
for my home ~/.bashrc
JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun/
export JAVA_HOME
PATH=${PATH}:$JAVA_HOME/bin
export JAVA_HOME
PATH=${PATH}:$JAVA_HOME/bin
all done.
转载于:https://blog.51cto.com/speedooo/116613