JDK

Sajan Parikh sajan at noppix.com
Tue Jun 25 04:54:16 UTC 2013


Ubuntu is based on Debian, you cannot install RPM packages the same way 
you do on a Red Hat or CentOS machine.  Debian/Ubuntu 'packages' are 
usually in a .deb file.

For Oracle JDK however, there is no .deb file.  Webupd8 has very well 
maintained PPA to easily get Oracle Java installed and running with just 
a few commands.

Here are the 3 commands you need to run assuming you haven't screwed up 
your system too badly trying to install an RPM on a Debian/Ubuntu 
system, ;).

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

First command adds the PPA, which can be thought of as a repository.  
Second command, updates your available packages taking this new PPA into 
account.  Third, downloads and runs the Java JDK/runtime installer from 
that webupd8 PPA.

That installer is by far the easiest way to get Java going.  It uses the 
actual Java download directly from Oracle, but handles the messy install 
since there is no official .deb.

More details on the Webup8 PPA for Java can be found on there site, 
http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html.

Sajan Parikh
/Owner, Noppix LLC/

e: sajan at noppix.com
p: (563) 726-0371

Noppix LLC Logo
On 06/24/2013 11:47 PM, Alex Chen wrote:
> I try to install JDK 7 from Oracle web site to Ubuntu 13 but are 
> having several problems.
> 1.  If I use the RPM package, I encounter the following error:
> dev at ubuntu:~/Downloads$ sudo rpm -i jdk-7u25-linux-x64.rpm
> [sudo] password for dev:
> rpm: RPM should not be used directly install RPM packages, use Alien 
> instead!
> rpm: However assuming you know what you are doing...
> error: Failed dependencies:
>     /bin/basename is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /bin/cat is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /bin/cp is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /bin/gawk is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /bin/grep is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /bin/ln is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /bin/ls is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /bin/mkdir is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /bin/mv is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /bin/pwd is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /bin/rm is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /bin/sed is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /bin/sort is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /bin/touch is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /usr/bin/cut is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /usr/bin/dirname is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /usr/bin/expr is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /usr/bin/find is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /usr/bin/tail is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /usr/bin/tr is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /usr/bin/wc is needed by jdk-2000:1.7.0_25-fcs.x86_64
>     /bin/sh is needed by jdk-2000:1.7.0_25-fcs.x86_64
>
> These errors do not make sense because the commands are all in the 
> system.
>
> 2.  If I extract the RPM with rpm2cpio and put the binaries and 
> libraries in the following locations:
> dev at ubuntu:/usr/java$ ls -l
> total 4
> lrwxrwxrwx 1 root root   16 Jun 23 21:38 default -> /usr/java/latest
> drwxr-xr-x 8 root root 4096 Jun 23 21:35 jdk1.7.0_25
> lrwxrwxrwx 1 root root   21 Jun 23 21:37 latest -> /usr/java/jdk1.7.0_25
>
> dev at ubuntu:/usr/java/default/bin$ ldd java
>     linux-vdso.so.1 =>  (0x00007fff7f324000)
>     libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
> (0x00007f41eff22000)
>     libjli.so => 
> /usr/java/jdk1.7.0_25/bin/./../jre/lib/amd64/jli/libjli.so 
> (0x00007f41efd0b000)
>     libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f41efb06000)
>     libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f41ef73e000)
>     /lib64/ld-linux-x86-64.so.2 (0x00007f41f0154000)
>
> dev at ubuntu:/usr/bin$ ls -l ja*
> lrwxrwxrwx 1 root root 25 Jun 23 21:45 jar -> /usr/java/default/bin/jar
> lrwxrwxrwx 1 root root 26 Jun 23 21:43 java -> /usr/java/default/bin/java
> lrwxrwxrwx 1 root root 27 Jun 23 21:43 javac -> 
> /usr/java/default/bin/javac
> lrwxrwxrwx 1 root root 29 Jun 23 21:43 javadoc -> 
> /usr/java/default/bin/javadoc
> lrwxrwxrwx 1 root root 28 Jun 23 21:45 javaws -> 
> /usr/java/default/bin/javaws
>
> 3. When I run java, I get the following error:
> dev at ubuntu:~$ which java
> /usr/bin/java
> dev at ubuntu:~$ java
> Error occurred during initialization of VM
> java/lang/NoClassDefFoundError: java/lang/Object
>
> I am able to install the same RPM on Centos 6.4 without any problem.
> Has anyone installed JDK ( from Oracle ) on Ubuntu 13?
>
> Thanks.
>
> Alex
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20130624/c6836cf7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: emailsiglogo.png
Type: image/png
Size: 6717 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20130624/c6836cf7/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4473 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20130624/c6836cf7/attachment.bin>


More information about the ubuntu-users mailing list