`
mmdev
  • 浏览: 12954406 次
  • 性别: Icon_minigender_1
  • 来自: 大连
文章分类
社区版块
存档分类
最新评论

Install the Oracle JDK 6

 
阅读更多

Oracle themselves have the official guide to install their JDK - below is based upon those instructions.

  • Download the 32bit or 64bit Linux "compressed binary file" - it has a ".bin" file extension
  • Give it permissions to execute and extract it

    chmod a+x [version]-linux-i586.bin

    ./[version]-linux-i586.bin

During installation it will ask you to register - press ENTER. Firefox will open with the registration page. Registration is optional.

JDK 6 package is extracted into ./jdk1.6.0_x directory, for example ./jdk1.6.0_30.

Lets rename it:

mv jdk1.6.0_30 java-6-oracle
  • Now move the JDK 6 directory to /usr/lib

sudo mkdir /usr/lib/jvm

sudo mv java-6-oracle /usr/lib/jvm

switch to Oracle JDK 6

webupd8.googlecode.com hosts a nice-easy script to help with this.

wget http://webupd8.googlecode.com/files/update-java-0.5b
chmod +x update-java-0.5b
sudo ./update-java-0.5b

don't worry - 0.5b refers to the script version - not the version of java!

An alternative to this is to use the webupd8 ppa and the update-java package.

enter image description here

Finally test the switch has been successful:

java -version
javac -version

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics