3

I have Oracle Java installed on my computer. Latest version 1.7 and path variables set properly. But most applications in Ubuntu from Software Center that require Java needs Open JDK Iced Tea etc. I want to install applications in Ubuntu without installing any other versions of JDK/JRE. How's that possible.

EDIT

Just giving you an example. I have Oracle Java(JDK 7) installed but when I want to install Netbeans via Software Center it is asking to install Open JDK. Netbeans I had to install directly via downloading the binaries. Similarly many other softwares exist.

9
  • What applications are you referring to that require OpenJDK rather than Oracle's Java? (Oracle bought Sun Microsystems a year or so ago). Apr 21, 2013 at 18:52
  • @ClivevanHilten just giving you an example. I have Oracle Java(JDK 7) installed but when I want to install Netbeans via Software Center it is asking to install Open JDK. Apr 21, 2013 at 19:26
  • Basically any java driven application from the software centre lists openJDK as a dependency, I have the same issue. For netbeans download the official installer off their website. Apr 21, 2013 at 19:27
  • @handuel I did that. but that's not the only case. I downloaded one deb file for another package that has java as dependency. And am helpless as the Ubuntu version is in deb format. Apr 21, 2013 at 19:29
  • I think there is a .sh installer, I'll go hunting Apr 21, 2013 at 19:30

2 Answers 2

2

Try installing openjdk, but using sudo update-alternatives --install /path/to/suns-java/java 1 sudo update-alternatives --config java from the terminal to set suns java to the default. (You may also have to do the same for javac, javaw and javaws).

0

Ubuntu supports OpenJDK out of the box. Leave OpenJDK installed. This way installing software that rely on Java will not reinstall OpenJDK each time.

After installing Oracle Java 7, use your environment variables and the Ubuntu alternatives system to configure Oracle JDK as the default.

When installing software like NetBeans you will have to consult the Netbeans documentation and specifically configure Netbeans to work with the Oracle JDK instead of OpenJDK. Some software detect your default Java from the environment variables while others don't.

Here is a blog entry that installs Oracle Java 7 using the Ubuntu alternatives system: http://hendrelouw73.wordpress.com/2013/04/16/how-to-install-oracle-java-7-update-21-on-ubuntu-12-04-linux/

Here is a link to the update-alternatives command: http://manpages.ubuntu.com/manpages/precise/man8/update-alternatives.8.html

You must log in to answer this question.

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