Ubuntu – Downgrade from OpenJDK 8 to OpenJDK 6

javajdkopenjdk

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!

Best Answer

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.