tags:

views:

573

answers:

4

Ever since I upgraded my Ubuntu from 9.10 to 10.04 I can't start Netbeans any more, because apparently they are dropping support for Java's JDK in favor of OpenJDK. Well, problem is, my IDEs won't work with OpenJDK.

apt-get install sun-java6-jdk is not working. I downloaded the Linux installation file from Sun (jdk-6u21-linux-i586.bin) and installed it, but I can't call java or javac from the terminal.

Can anyone help me here?

+2  A: 

Here is how you would install it.

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6

Good luck.

Pablo Santa Cruz
+1  A: 

How to install Java6 JDK on Ubuntu 10.04

zengr
+2  A: 

The NetBeans installation has a reference to the JDK that is created at install time. After the upgrade to 10.04, that reference is no longer valid.

Go to the directory where you installed NetBeans. By default it is "/usr/local/netbeans-version" if you installed as root or "$HOME/netbeans-version" if you installed as a regular user. There will be a subdirectory named "etc". In that directory, edit the "netbeans.conf" file. Look for the netbeans_jdk_home and change it to /usr/lib/jvm/java-6-openjdk.

Devon_C_Miller
+1 though it's too late for that. I managed to install the official SDK. I don't think the OpenJDK should even exist, but that's another discussion.
NullUserException
A: 

I downloaded the Linux installation file from Sun (jdk-6u21-linux-i586.bin) and installed it, but I can't call java or javac from the terminal.

You missed the final step: after installing the JDK manually (instead of from the package system), you need to add the bin directory of your JDK to the PATH. The best way to do that in Ubuntu 10.04 is to edit the file /etc/environment: sudo nano /etc/environment. Log out and back in and you should be able to run Java.

Jesper