Sunday, November 24, 2013

Install java6 jdk from oracle binary instead of using "apt-get install sun-java6-jdk"

For Android platform development, we need java6.
But the guide is outdated. "sun-java6-jdk" is deprecated! ;-(

We have to find another way.

First of all, we need oracle java6 jdk binary.

The url is Oracle download page. You need your account on for downloading it.

tmax@tmax3:~/work/android$ chmod +x jdk-6u45-linux-x64.bin
tmax@tmax3:~/work/android$ ./jdk-6u45-linux-x64.bin
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (
replace jdk1.6.0_45/db/bin/ij? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
  inflating: jdk1.6.0_45/db/bin/ij
  inflating: jdk1.6.0_45/db/bin/NetworkServerControl
  inflating: jdk1.6.0_45/db/bin/setNetworkClientCP.bat
  inflating: jdk1.6.0_45/db/bin/setEmbeddedCP.bat
  inflating: jdk1.6.0_45/db/bin/stopNetworkServer.bat

I set up my  environment by following (
 ). But I failed. Compiling failed with the error message below.
host Java: jsilver (out/host/common/obj/JAVA_LIBRARIES/jsilver_intermediates/classes)
Note: external/jsilver/src/org/clearsilver/ uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
jar: internal error: -C (No such file or directory)
make: *** [out/host/common/obj/JAVA_LIBRARIES/jsilver_intermediates/javalib.jar] Error 1
make: *** Deleting file `out/host/common/obj/JAVA_LIBRARIES/jsilver_intermediates/javalib.jar'

The guide use "update-alternatives" utility for manual setup ("manual" means not-using-apt-get). It looks fancy. But something is wrong: conflict with pre-installed gcj java(GNU Compiler for Java). I could not fix it up. No idea about "update-alternatives".

So I just followed ( I set PATH=$JAVA_HOME/bin:$PATH in .bashrc. The site gave good resource.

1 comment:

Jae-Young Lee said...

Download page for JDK8 is