Swapping OpenJDK for Sun JDK on Ubuntu

Recently I installed PhpStorm on Ubuntu that requires Sun JDK rather than the OpenJDK that Ubuntu installs with. It wasn't a matter of it running better with the Sun solution, which is proprietary...it doesn't run at all with OpenJDK. I tried simply uninstalling OpenJDK and installing Sun's JDK, but that didn't work...there were missing headers, etc., cryptic messages to a Linux n00b. I did find the solution, though, and am posting it here to make someone else's life easier.


sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin
sudo update-alternatives --config java

I found some interesting comments about Sun JDK vs OpenJDK. In particular, that the Sun version is much better with graphics and fonts, and is much faster. Time will tell.

5 comments

by Frank Gelinas (not verified) on Tue, 2011-04-12 19:21
Thank you, I've been trying to switch the java runtime for phpstorm for too long already :)

by luban (not verified) on Tue, 2012-12-25 00:42
Pretty nice post. I just stumbled upon your weblog and wanted to say that I've really enjoyed surfing around your blog posts. After all I will be subscribing to your rss feed and I hope you write again soon!

by The same thing, guy (not verified) on Tue, 2011-11-15 05:05
I don't know either I am sooooo stupid or what, I've been trying chaotically to install Java for WebStorm for an hour and only your article helped me.

by maruccio (not verified) on Fri, 2012-02-17 13:32
thanks! nice blog!

by Guerzizeb (not verified) on Sun, 2012-07-01 08:58
<p>Works fine, thanks</p>
Design by Ayen Designs. Underlying Drupal theme by Kiwi Themes.