How to use Eclipse with the JDKs provided by 12.04?

I updated to Ubuntu 12.04 and now Eclipse does not accept OpenJDK 6 in /usr/lib/jvm anymore. I tried to install openjdk 7 and it did create two folders in /usr/lib/jvm, but neither is accepted by the Eclipse JDK dialog.

Edit: I am referring the the JDK that is used to compile and execute the written programs. Not the JRE used to run eclipse. This especially means that using the proprietary JDK is not an option for me.

3 Answers

Like maxym said, it's a good idea to install the sun jdk for use with eclipse. You can find a detailed answer to that here.

Dont use the JDK shipped with ubuntu. Eclipse is much more stable with the certified jre - it the sun's one.

  1. Go to java.com and download jre-6u31-linux-x64.bin (or i386 version, depends on you OS version.
  2. execute than file (it's a self extracting archive). It'll create the folder jre1.6.0_31
  3. In you eclipse installation edit the file eclipse.ini and add

    -vm

    /path_where_you_extracted/jre1.6.0_31/bin/java

This two lines whould be added before -vmargs It's important!

It should work now.

Please retry selecting one of the sub directories, e.g. /usr/lib/jvm/java-6-openjdk-amd64. There seems to be a bug in the preferences dialog, as I also experienced that the same path was rejected the first time, but accepted the next time.

It may have to do with whether you try to input the path into the text field or if you use the directory chooser.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like