sudo add-apt-repository ppa:sun-java-community-team/sun-java6
sudo apt-get update
sudo apt-get install sun-java6-jdk
- 设置当前默认的java解释器和编译器: (ubuntu9.10如果没有安装多个java虚拟机的话可以跳过这一步。)
sudo update-alternatives --config java
There are 2 alternatives which provide `java'. Selection Alternative ----------------------------------------------- # /usr/bin/gij-wrapper-4.1 *+ 2 /usr/lib/jvm/java-6-sun/jre/bin/java Press enter to keep the default[*], or type selection number:
sudo update-alternatives --config javac
- 配置JAVA环境变量:
sudo gedit /etc/environment
JAVA_HOME=/usr/lib/jvm/java-6-sun CLASSPATH=.:/usr/lib/jvm/java-6-sun/lib
. /etc/environment
- 配置JVM的优先级: (ubuntu9.10如果没有安装多个java虚拟机的话可以跳过这一步。)
sudo gedit /etc/jvm
/usr/lib/jvm/java-6-sun
- 安装浏览器的JAVA Plugin(推荐安装):
sudo apt-get install sun-java6-plugin
- 中文字体设置:如果使用文鼎字体应该可以奏效,但是或许出现空格,那么可以编辑
/usr/lib/jvm/java-6-sun/jre/lib/fonts/fonts.dir