android編譯一開始就出現錯誤, 系統告知JDK不支援目前的編譯環境
怪了!之前還可以的耶…(因為我之前是裝sun jdk), 應該是後來有裝OpenJDK套件導致這個錯誤吧
Checking build tools versions…
************************************************************
You are attempting to build with an unsupported JDK.You use OpenJDK but only Sun/Oracle JDK is supported.
************************************************************
由於我還保有原本安裝的sun JDK
所以只要在ubuntu的電腦上透過指令切換版本即可
In Ubuntu you don't have to uninstall one JDK to use another. You can have multiple Java versions installed and switch between them as you like. What matters is witch one is set as default.Chose another Java loader:sudo update-alternatives --config javaChose another compiler (this is what you need):sudo update-alternatives --config javacChose Java Web Start:sudo update-alternatives --config javaws
備註:
之前在ubuntu10.x版本時, 要編譯Android的環境設置
只要透過 apt-get install sun-java6-jdk 即可安裝, 現在再輸入指令已經找不到了
Ubuntu11.x之後版本, 要透過手動安裝Sun JDK…
1.去Oracle下載頁面2.選"Java SE 6", 再選"Java SE Development Kit 6u45" (可能需註冊)3.下載後的安裝指令://Make the downloaded binaries executable.chmod u+x jdk-6u45-linux-x64.bin//Extract it./jdk-6u45-linux-x64.bin//The usr/lib/jvm is the default installation directory of the Java JDK and the Java JREsudo mkdir -p /usr/lib/jvmsudo mv jdk1.6.0_45 /usr/lib/jvm///Inform Ubuntu where your Java installation is located.sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_45/bin/java" 1sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_45/bin/javac" 1sudo update-alternatives --install "/usr/bin/javah" "javah" "/usr/lib/jvm/jdk1.6.0_45/bin/javah" 1sudo update-alternatives --install "/usr/bin/javap" "javap" "/usr/lib/jvm/jdk1.6.0_45/bin/javap" 1sudo update-alternatives --install "/usr/bin/javadoc" "javadoc" "/usr/lib/jvm/jdk1.6.0_45/bin/javadoc" 1sudo update-alternatives --install "/usr/bin/jar" "jar" "/usr/lib/jvm/jdk1.6.0_45/bin/jar" 1//Select your default Java installation & Inform Ubuntusudo update-alternatives --config javasudo update-alternatives --config javacsudo update-alternatives --config javahsudo update-alternatives --config javapsudo update-alternatives --config javadocsudo update-alternatives --config jar
沒有留言:
張貼留言