1

I installed Ubuntu 10.04 which by default came with OpenJDK. I've since installed Sun's Java 6 using apt-get. When I type java -version I get:

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

However, when I start Tomcat it still appears to using Open JDK.

Using JRE_HOME:        /usr/lib/jvm/java-6-openjdk

What's the best way to globally point to Sun's Java? Is there a way to uninstall Open JDK?

2 Answers 2

1

Have you looked at the update-alternatives command? You would use it like this: sudo update-alternatives --config java and then choose the version you want.

See the Ubuntu Java page for more details.

Hope it helps.

0

update-alternatives as canen mentioned is the way to go if you want to set the Java default for the whole system.

Regarding Tomcat on Ubuntu 10.04, I suggest taking a look at the Tomcat page in the Ubuntu wiki especially the paragraph titled "Changing JVM used".

In short: change the JAVA_HOME variable in /etc/default/tomcat6.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .