27 06 2010

ubuntu 10.04 安装 Sun Java jdk

bigCat Posted in Linux - Comment.isBlank

ubuntu 10.04 去掉了sun-jdk 并推荐用openjdk\r\n\r\n但是 Intellij IDEA 不推荐openjdk,所以偶还是要用sun-jdk\r\n\r\n\r\nsudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"\r\nsudo apt-get update\r\n\r\n\r\nSynaptic Package Manager里就能搜到jdk了\r\nsudo gedit /etc/environment\r\n\r\n在 environment中修改如下信息:\r\nPATH="/home/damao/Programs/idea/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java-6-sun/bin"\r\nJAVA_HOME="/usr/lib/jvm/java-6-sun"\r\nCLASSPATH=".:/usr/lib/jvm/java-6-sun/lib"\r\nJDK_HOME="/usr/lib/jvm/java-6-sun"\r\n\r\nJDK_HOME这个是Intellij IDEA要用的,和JAVA无关\r\n\r\n由 于ubuntu中有默认jdk还需要执行如下工作\r\n执行\r\n代码:\r\nsudo update-alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_20/bin/java 300\r\nsudo update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_20/bin/javac 300\r\n\r\n将我们安装的JDK加入java选单\r\n\r\nsudo update-alternatives --config java\r\n\r\n设置系统默认的JDK\r\n\r\njava -version

Host: (miao) | Word: Press | Code: HTML5