Ubuntu – Installing JDK.rpm file using alien

javajdknetbeansoraclesoftware installation

I'm trying to install JDK on my Ubuntu virtual machine to use it for Netbeans but for some reason it won't work. I downloaded JDK from oracle's site, the .rpm file. I read online that I should use

sudo alien -g packagename.rpm 

to change the file from .rpm to .deb but it just like extracted my archive and nothing else. There's no .deb file anywhere, no executable either. I'm completely lost. Now if I do sudo aline -g package.rpm again, it says that there's already a folder with the name created but I'm stuck. What else should I do to install the JDK?

enter image description here

Best Answer

First read the whole answer. The first part shows you your errors and the second part shows you that alien is not necessary.

First Part

Use -d to create a DEB file

alien -d packagename.rpm

or

alien packagename.rpm

from man alien

-d, --to-deb
    Make debian packages. This is the default.

-g, --generate
    Generate a temporary directory suitable for building a package from,
    but do not actually create the package. This is useful if you want to
    move files around in the package before building it. The package can be
    built from this temporary directory by running "debian/rules binary",
    if you were creating a Debian package, or by running "rpmbuild -bb
    <packagename>.spec" if you were creating a Red Hat package.

Second Part

To install Oracle Java you don't need alien and a RPM file. Simply use the following commands.

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
Related Question