Ubuntu – Android KitKat build on Ubuntu 14.04, Wrong JDK

14.04aptjdkoracle

I am trying to build Android-x86 KitKat branch from android-x86.org on an Ubuntu 14.04 64-bit machine.

However, when I run make it doesn't run very long until there is an error which halts compilation. It appears to be a Java error which I believe is caused by the JDK Version I have installed.

libcore/libdvm/src/main/java/java/lang/Enum.java:150: error: ordinal has private access in Enum
        return ordinal - o.ordinal;
                          ^

I understood for KitKat that JDK 6 is needed, so I installed OpenJDK6. I know this is not fully supported, but there was nothing to say it absolutely WON'T work. So I tried it anyway.

Anyway, my problem is that I cannot find a way of getting the oracle JDK 6 installed. I have tried some repositories but they are either obsolete or no longer have the necessary package. I went on the Oracle website archive, but it demands that I sign up with details of "my company" that I do not have to give them.

Is there any way I can get an old oracle JDK version installed?

Best Answer

That may be an OpenJDK issue. Sometimes the Oracle JDK is required in order to get something to work.

Generally the JDKs are downwards compatible, you could as well use version 8.

Here is a tutorial how to install it: http://docs.oracle.com/javase/8/docs/technotes/guides/install/linux_jdk.html

If you already installed (read: put it somewhere on your drive) the Oracle JDK, you can choose it with

update-alternatives --config java

I had problems with that before, if the JDK you want isn't listed, you have to add it to update-alternatives first:

sudo update-alternatives --install /usr/bin/java java /path/to/your/jdk/bin 1

Replace /path/to/your with your path.

Related Question