Building android source due to openjdk java version

I am trying to build an andorid source tree using unbuntu13.10 on intel-corei7 installed on a Windows 8 system (replaced Windows 8 with ubuntu). Builing source has issue related to java jdk version.

Any suggestion or hint that might be wrong will help. The html file that the error points to does not help much.

Issue # After I checked the source tree as master using "repo init" and "repo sync"
 I try to build using:

         . build/envsetup.sh
         lunch aosp_arm-eng
         make -j4

getting below error:

    You are attempting to build with an unsupported JDK.
    You use OpenJDK but only Sun/Oracle JDK is supported. Please follow the machine setup instructions at https://source.android.com/source/download.html
    build/core/main.mk:175: * stop. Stop.
  • confirmed that my root directory is below the path with all the necessary java libraries.

     mydir@mydir-laptop:/usr/lib/jvm$ ls java-1.6.0-openjdk-amd64 
     java-1.7.0- openjdk-amd64 java-6-openjdk-amd64 
     java-6-openjdk-common java-7-openjdk-amd64
    

/home/mydir/WORKING _DIRECTORY /usr/lib/jvm root to/home/mydir .

  1. verified main.mk: , , require_openjdk ifneq .

     EXPERIMENTAL_USE_JAVA7 requires_openjdk := false 
     ifneq ($(shell java -version 2>&1 | grep -i openjdk),)
    
  2. Java:

    java version "1.7.0_51" 
     OpenJDK Runtime Environment (IcedTea2.4.4)    
     (7u51-2.4.4-0ubuntu0.13.10.1) 
     OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
    
  3. envsetup.sh ,

     java-7-openjdk-amd64 
     if [ ! "$JAVA_HOME" ]; then 
     if [ ! "$EXPERIMENTAL_USE_JAVA7" ]; then case uname -s in Darwin) 
     export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions /1.6/Home ;; *) 
     export JAVA_HOME=/usr/lib/jvm/java-6-sun ;;
     esac else case uname -s in Darwin) 
     export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home ;; *) 
     export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 ;; 
     esac fi
    
    # Keep track of the fact that we set JAVA_HOME ourselves, so that 
    # we can change it on the next envsetup.sh, if required. 
    export ANDROID_SET_JAVA_HOME=true fi }
    
+4

Source: https://habr.com/ru/post/1534208/


All Articles