Ubuntu: How to Install JDK 1.7 using a RPM package?


Edit Start

I have had eclipse running for a while now. And have been developing a java based server.

Edit End

Today, eclipse, java project, right click, properties, java build path (jdk 1.6) is suddenly reporting missing jars `(netx.jar, plugin.jar and gnome-java-bridge.jar). May be after a ubuntu auto update these jars went missing. It has also happened to my laptop a few days back.

java -version

java version "1.6.0_24"  OpenJDK Runtime Environment (IcedTea6 1.11.3) (6b24-1.11.3-1ubuntu0.10.04.1)  OpenJDK Server VM (build 20.0-b12, mixed mode)  

I could not find anyone else having a similar issue, so I thought I'll upgrade to 1.7. So I downloaded 1.7 jdk and jre from oracle

I ran the following, on my Ubuntu 10.04

sudo apt-get install alien dpkg-dev debhelper build-essential  sudo alien jre-7u5-linux-i586.rpm  sudo alien jdk-7u5-linux-i586.rpm  

Unfortunately both report errors. These folders do exist in the path.

make: *** [binary-arch] Error 9  find: `jdk-1.7.0_05': No such file or directory      make: *** [binary-arch] Error 9  find: `jre-1.7.0_05': No such file or directory  

Now when I try to install again, using sudo alien jdk-7u5-linux-i586.rpm I get

error: incorrect format: unknown tag  Warning: Skipping conversion of scripts in package jdk: postinst postrm prerm  Warning: Use the --scripts parameter to include the scripts.  mkdir: cannot create directory `jdk-1.7.0_05': File exists  unable to mkdir jdk-1.7.0_05:  at /usr/share/perl5/Alien/Package.pm line 257.  


You question is a little bit confusing: you want to know how to patch this Eclipse behaviour or you want to update Java?

The title says 1 thing, the question says another.

If you just want to start eclipse using a specific version of a particular JVM you just have to open the file eclipse.ini in the same folder where the eclipse executable is and add this 2 lines:

-vm  /home/user/jdk/bin/java  

This option is pretty self explanatory, you just use the -vm option and specify the full path of your jvm of choice.

If you want to install java from a package downloaded from the internet you need another guide, please be more clear.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »