I have a small app which crashes if I run it with open-jdk/jre so I would like to run it with oracles Java, how can I force it to run with the original Java? I use ubuntu 12 lts.

有帮助吗?

解决方案

Set the default jvm as oracle java.. then try it.

Switching between installed Java versions can be accomplished using the update alternatives command.

To get a list of your installed Java platforms, run the following command from the terminal:

      sudo update-alternatives --config java

This will give you a list output similar to this:

There are 2 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------0 /usr/lib/jvm/java-6-oracle/jre/bin/java

auto mode

1070

1 /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java 1051 manual mode * 2 /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java 1069 manual mode Press enter to keep the current choice[*], or type selection number:

In this case, the Open JDK 6 version is running. To switch to the Open JDK version 7, you would select option1 at the prompt and press the Enter key.

You will now be running the OpenJDK 7 version. No other changes will be needed to switch your Java versions.

Or to set Oracle jdk do similar

其他提示

Uninstall the openjdk and install the Oracle jdk. Take a look here http://m.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top