Muffinresearch Labs by Stuart Colville

Ubuntu: Changing the default java binary | Comments (0)

Posted in Code, Linux/Unix on 5th December 2009, 3:03 pm by Stuart

Since upgrading to Karmic I’ve had a weird issue with Charles Proxy in that the windows for settings like rewrites seemed to get completely screwed up making it very difficult to see the boxes for entering information. Here’s a screenshot of what it looks like broken.

Karl von Randow the author of Charles was looking into the issue following my bug report and after he’d been unable to reproduce the issue in a fresh install of Ubuntu Karmic with a Java Runtime downloaded from the sun site he suggested I do the same, as I was currently showing that I was running the OpenJDK java runtime.

This prompted me to do a little more digging as I prefer to only use packaged software where possible mainly for the big benefit of getting security and other updates as soon as they are made available.

On my system I had both the sun-java6-jre package as well as the openjdk-6-jre package installed.

To check which one you are using run the following command from the terminal:

$ java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.6.1) (6b16-1.6.1-3ubuntu1)
OpenJDK Server VM (build 14.0-b16, mixed mode)

To fix the problem I used the following command to switch to the SUN java binary.

sudo update-alternatives --config java
# Enter password #
There are 2 choices for the alternative java (providing /usr/bin/java).

 Selection    Path                                      Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      auto mode
 1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
 2            /usr/lib/jvm/java-6-sun/jre/bin/java       63        manual mode

Selecting 2 and hit enter and now the version is as expected.

$ java -version
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) Server VM (build 14.1-b02, mixed mode)

Running Charles again the windows that were broken now display correctly.

Post Tools

Comments: Add yours







XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Using Loggerhead with mod_wsgi|(0)

Here’s a post I wrote over on the Project Fondue Blog about our use of Loggerhead with mod_wsgi under Apache. Loggerhead is the rather nice branch viewer for bazaar branches as used on Launchpad.net.

If you’re not already subscribed to the Project Fondue blog feed then I can recommend it, as there should be some interesting posts coming out of there in the coming months (yes I’m unashamedly biased!).

Ubuntu: Turn off changing workspace with mouse wheel|(1)

I found the changing with the workspace with the mouse wheel really annoying. To disable it go to System => Preferences => CompizConfig (available if the compizconfig-settings-manager package is installed) and uncheck “Viewport Switcher” which is under the “Desktop” heading.

Photos on Flickr

© Copyright 2004-10 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.592s.