Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Charles Oliver Nutter edited this page · 7 revisions
Clone this wiki locally

JRuby With Wrong Java


You may find that even though you have an up-to-date JDK installed, JRuby does not work on Ubuntu. When running jruby -v, you might get exceptions from Java. The reason for these errors might be that, even though you have an up-to-date JDK installed, Ubuntu is not using it by default. You need to update your configuration to use the proper JDK. See for more information on this issue.

On Ubuntu 7.10, I ran

 java -version

which said that I was running Java version 1.5.0 when I knew I had Java version 1.6 installed. I then ran:

 sudo update-alternatives --config java

I picked the option /usr/lib/jvm/java-6-sun/jre/bin/java. Following that, running java -version gave me

 java version "1.6.0_03"
 Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
 Java HotSpot(TM) Server VM (build 1.6.0_03-b05, mixed mode)

And JRuby then worked fine.

Something went wrong with that request. Please try again.