Downgrade from OpenJDK 8 to OpenJDK 6

10,394

Solution 1

Ok so finally got it to work

I went to http://www.oracle.com/technetwork/java/javase/archive-139210.html and downloaded jdk-6u45-linux-i586.bin

I installed the 32 bit libraries

sudo apt-get install lib32z1

then

chmod +x jdk-6u45-linux-i586.bin
./jdk-6u45-linux-i586.bin

then followed this post How do I install Oracle JDK 6?

and had to add the webupd8 repo and do

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo update-java
java -version

Solution 2

OpenJDK 6 is still in Ubuntu Trusty :

http://packages.ubuntu.com/search?keywords=openjdk

If you have a reasonably powerful computer you could consider using Qemu/KVM or VirtualBox and install Ubuntu Trusty (14.04) as a guest VM. That would be the most clean solution in my opinion.

There's also a ppa for OpenJDK 6 which might or might not work in your Xenial install by editing the downloaded sources list file (Changing xenial into trusty) :

https://launchpad.net/ubuntu/+source/openjdk-6

In the latter case I recommend to remove the OpenJDK-8 first.

Share:
10,394

Related videos on Youtube

pottedmeat7
Author by

pottedmeat7

http://jellyware.xyz

Updated on September 18, 2022

Comments

  • pottedmeat7
    pottedmeat7 over 1 year

    I have Ubuntu 16.04 (32bit) I have openjdk version "1.8.0_121"

    I am getting an error from a makefile saying:

    You are attempting to build with the incorrect version
    of java.
    
    Your version is: openjdk version "1.8.0_121".
    The correct version is: Java SE 1.6.
    

    I have tried

    sudo apt-get install openjdk-6-jdk
    

    returned

    openjdk-6-jdk has no installation candidate
    

    Tried going to http://www.oracle.com/technetwork/java/javase/archive-139210.html

    Wont install because of multiple errors

    Unpacking...
    Checksumming...
    Extracting...
    ./jdk-6u45-linux-i586-rpm.bin: 144: ./jdk-6u45-linux-i586-rpm.bin: ./install.sfx.17173: not found
    Installing JavaDB
    rpm: RPM should not be used directly install RPM packages, use Alien instead!
    rpm: However assuming you know what you are doing...
    error: open of sun-javadb-common-10.6.2-1.1.i386.rpm failed: No such file or directory
    error: open of sun-javadb-core-10.6.2-1.1.i386.rpm failed: No such file or directory
    error: open of sun-javadb-client-10.6.2-1.1.i386.rpm failed: No such file or directory
    error: open of sun-javadb-demo-10.6.2-1.1.i386.rpm failed: No such file or directory
    error: open of sun-javadb-docs-10.6.2-1.1.i386.rpm failed: No such file or directory
    error: open of sun-javadb-javadoc-10.6.2-1.1.i386.rpm failed: No such file or directory
    
    Done.
    

    Also tried the non rpm version from http://www.oracle.com/technetwork/java/javase/archive-139210.html and got:

    Unpacking...
    Checksumming...
    Extracting...
    ./jdk-6u45-linux-i586.bin: 74: ./jdk-6u45-linux-i586.bin: ./install.sfx.17296: not found
    Failed to extract the files.  Please refer to the Troubleshooting section of
    the Installation Instructions on the download page for more information.
    

    Somewhere I found openjdk-6_6b38-1.13.10.orig.tar.gz forget where I got that, but it was complaining I didn't have a JDK home directory.

    configure: error: "A JDK home directory could not be found."
    

    Im just digging deeper and nothing is working. Wondering if theres some simple repo that I can get openjdk-6-jdk that will actually work?

    Thanks!

    • gsxruk
      gsxruk over 7 years
      When you downloaded from Oracle it looks like you downloaded the rpm version. You should try to download the other version "jdk-6u45-linux-i586.bin" to use on Ubuntu.
    • pottedmeat7
      pottedmeat7 over 7 years
      Tried that too, edited post to show results. No luck with that either.
    • gsxruk
      gsxruk over 7 years
      Are you installing this on an x64 system? If so, try the answer in this post. You will possibly need to install the 32 bit libraries with sudo apt-get install lib32z1.
    • pottedmeat7
      pottedmeat7 over 7 years
      Edited. Im on 32bit
    • pottedmeat7
      pottedmeat7 over 7 years
      Ok was able to run ./jdk-6u45-linux-i586.bin after installing lib32z1 was able to follow this post askubuntu.com/questions/67909/how-do-i-install-oracle-jdk-6 moved the extracted into /usr/lib/jvm but the script webupd8.googlecode.com/files/update-java-0.5b was a 404 still don't have an active java installation... java -version doesn't work the script in the post
    • gsxruk
      gsxruk over 7 years
      You would need to set it as your default. This post provides a working example in the question.