Find the answer to your Linux question:
Results 1 to 7 of 7
I thought I knew how to do that; I have been using Java for programming for ages. I had Ubuntu 13.10 on an Acer Chromebook C720 until earlier this week, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2007
    Location
    Middlesbrough, Yorkshire
    Posts
    37

    How to Install Java8 on Ubuntu 14.04


    I thought I knew how to do that; I have been using Java for programming for ages. I had Ubuntu 13.10 on an Acer Chromebook C720 until earlier this week, when I made the mistake of installing Ubuntu 14.04, Not only does it load more slowly, but also it gvies errors with Java. I can do this
    sudo apt-get install openjdk-7-jdk
    java -version
    ...and get the appropriate response 1.7.0_51 IcedTea etc,
    but I want to use Java8, so I did what I have always done, something like this
    cd /usr
    sudo mkdir java
    sudo chown campbell java
    cd java
    tar -zxvf ~/Downloads/jdk-8-etc-linux-etc.tar.gz
    and got the usual output, a list of files being created. Now if I try to use it, things go wrong.
    campbell@xxxxx:~/java$ /usr/java/jdk1.8.0_05/bin/java -version
    bash: /usr/java/jdk1.8.0_05/bin/java: cannot execute binary file: Exec format error
    campbell@xxxxx:~/java$ java -version
    java version "1.7.0_51"
    OpenJDK Runtime Environment (IcedTea 2.4.6) (7u51-2.4.6-1ubuntu4)
    OpenJDK Server VM (build 24.51-b03, mixed mode)
    campbell@xxxxx:~/java$ java RussianMultiplication
    Usage java RussianMultiplication <123> <456>
    Default values 57 43 used
    Multiply with * and /
    57 * 43 = 2451
    Multiply with << and >>
    57 * 43 = 2451
    campbell@xxxxx:~/java$ /usr/java/jdk1.8.0_05/bin/java RussianMultiplication
    bash: /usr/java/jdk1.8.0_05/bin/java: cannot execute binary file: Exec format error
    It works all right with OpenJDK but the Oracle version doesn't. Whether it was exactly the same download as last week or a new download, I get that error. Similarly for Oracle Java7

    Anybody else ever seen that error? I shall probably revert to Ubuntu 13.10 for the time being.

    I have asked the same question here: How to Install Java8 on Ubuntu 14.04 (Beginning Java forum at JavaRanch)

  2. #2
    Linux Engineer
    Join Date
    Dec 2013
    Posts
    1,305
    Are you sure you downloaded the right version? The error makes it look like the binary is for another system.

    What is the output of :
    Code:
     file /usr/java/jdk1.8.0_05/bin/java

  3. #3
    Just Joined!
    Join Date
    Jun 2007
    Location
    Middlesbrough, Yorkshire
    Posts
    37
    Have already had the suggestion that I was mixing 32 bit and 64 bit programs on the Coderanch thread I quoted earlier. I did "ls" on my Downloads folder, where I had both the iso and the JavaŽ installation files, and could only find x64 or amd64 versions.
    Have reverted to U13.10, and am at present using the upgrade tool.
    This is what I get from file /usr/java/jdk1.8.0_05/bin/java
    /usr/java/jdk1.8.0_05/bin/java: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, BuildID[sha1]=0x29b774bd93ddbb4e723befe922ab5a9e1b683f8a, not stripped

  4. #4
    Just Joined!
    Join Date
    Jun 2007
    Location
    Middlesbrough, Yorkshire
    Posts
    37
    ... and thank you for the help.

  5. #5
    Just Joined!
    Join Date
    Feb 2014
    Posts
    45

  6. #6
    Just Joined!
    Join Date
    Jun 2007
    Location
    Middlesbrough, Yorkshire
    Posts
    37
    Quote Originally Posted by MadmanRB View Post
    try a ppa:

    . . .

    a lot less complicated for new users
    Isn't it! Thank you.

  7. #7
    Just Joined!
    Join Date
    Jun 2007
    Location
    Middlesbrough, Yorkshire
    Posts
    37
    I have tried the ppa technique and it works (thank you )
    I must have downloaded a 32 bit OS somewhere and thought it was 64. Thank you for your help, everybody.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •