LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Mobile (https://www.linuxquestions.org/questions/linux-mobile-81/)
-   -   jdk-5 error while building android source code (https://www.linuxquestions.org/questions/linux-mobile-81/jdk-5-error-while-building-android-source-code-868953/)

preetb123 03-16-2011 10:44 AM

jdk-5 error while building android source code
 
Hi, i am trying to build linux kernel for android emulator(Eclair version). i have downloaded the android source code, and also "$repo sync" was successful. now for Building, when i try to execute "$make" command i get the following error.
root@ubuntu:~/mydroid# make

PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=2.1-update1 TARGET_PRODUCT=generic TARGET_BUILD_VARIANT=eng TARGET_SIMULATOR= TARGET_BUILD_TYPE=release TARGET_ARCH=arm HOST_ARCH=x86 HOST_OS=linux HOST_BUILD_TYPE=release
BUILD_ID=ECLAIR

Checking build tools versions...

You are attempting to build with the incorrect version of java.

Your version is: /bin/bash: java: command not found. The correct version is: 1.5.

Please follow the machine setup instructions at http://source.android.com/download

build/core/main.mk:111: * stop. Stop.

i had open-jdk6 and sun-jdk-6 installed, now for building android source, it needs sun-jdk-1.5. for this i tried to install sun-jdk-1.5 from the .bin file, but the default JVM is not initialised to jdk-1.5, and i am not able to do it. i uninstalled open-jdk-6 but i couldnt remove sun-jdk-6. i have installed sun-jdk-6 from a .bin file from oracle/downloads.

i am following steps from below link

http://linuxclues.blogspot.com/2010/...ebian-sid.html

please tell me how can i uninstall jdk-6 and set the default jvm path to sun-jdk-5. or is there any other way to set the default jvm.. please help.

business_kid 03-16-2011 01:03 PM

Quote:

Your version is: /bin/bash: java: command not found. The correct version is: 1.5
What shows up in answer to 'which java'? Also be aware java binaries can be 32/64 bit sensitive. My 64 bit laptop needs a 32 bit version of java for OO.

paulsm4 03-16-2011 01:11 PM

Hi -

The warning is misleading:
Quote:

You are attempting to build with the incorrect version of java.

Your version is: /bin/bash: java: command not found. The correct version is: 1.5.
The problem is that the script isn't finding *any* version of Java.

JDK 1.6 works as well as JDK 1.5. Sun Java should work as well as Open Java (although, personally, I'd recommend Sun Java). Gnu Java (the default on many distros) will *not* work for Android.

The solution is to modify your $PATH variable so that the commands "java" and "javac" work from the command line.

Once that's taken care of, your build should work.

'Hope that helps .. PSM


All times are GMT -5. The time now is 03:19 AM.