jdk/java版本與Android源碼編譯中的錯誤

來源:互聯網
上載者:User

標籤:android   style   blog   class   code   java   

錯誤一:javap未指向有效java版本

 

Traceback (most recent call last):  File "../../base/android/jni_generator/jni_generator.py", line 1065, in <module>    sys.exit(main(sys.argv))  File "../../base/android/jni_generator/jni_generator.py", line 1061, in main    options.optimize_generation)  File "../../base/android/jni_generator/jni_generator.py", line 996, in GenerateJNIHeader    jni_from_javap = JNIFromJavaP.CreateFromClass(input_file, namespace)  File "../../base/android/jni_generator/jni_generator.py", line 507, in CreateFromClass    stderr=subprocess.PIPE)  File "/usr/lib/python2.7/subprocess.py", line 709, in __init__    errread, errwrite)  File "/usr/lib/python2.7/subprocess.py", line 1326, in _execute_child    raise child_exceptionOSError: [Errno 2] No such file or directorymake: *** [/home/odexcide/android-4./out/target/product/generic/obj/GYP/shared_intermediates/ui/gl/jni/Surface_jni.h] Error 1make: *** Waiting for unfinished jobs..

原因 javap不存在於環境變數中

使用 sudo update-alternatives --config javap 查看指向,選擇合適的版本,如果不存在,則添加javap

sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk1.6.0_45/bin/javap 300

配置 sudo update-alternatives --config javap 註:如果只有一個可選的話,則不會列表,即無需處理

 

錯誤二 Chromium gyp HashSet_jni.h 

out/target/product/mx3/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:10:26: error: extra tokens at end of #ifndef directive [-Werror]out/target/product/mx3/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:11:26: error: missing whitespace after the macro name [-Werror]target thumb C++: content_content_common_gyp <= external/chromium_org/content/common/android/surface_texture_peer.ccIn file included from external/chromium_org/content/common/android/hash_set.cc:5:0:out/target/product/mx3/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:24:20: error: expected initializer before ‘<‘ tokenout/target/product/mx3/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:26:17: error: expected initializer before ‘<‘ tokenout/target/product/mx3/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:29:22: error: expected ‘{‘ before ‘<‘ tokenout/target/product/mx3/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:29:22: error: expected unqualified-id before ‘<‘ tokenexternal/chromium_org/content/common/android/hash_set.cc:30:1: error: expected ‘}‘ at end of inputcc1plus: all warnings being treated as errorsmake: *** [out/target/product/mx3/obj/STATIC_LIBRARIES/content_content_common_gyp_intermediates/content/common/android/hash_set.o] 錯誤 1make: *** 正在等待未完成的任務....

這可能是由於java版本不符,請安裝相應版本的jdk。

此外, 如果尚未解決,可參考此帖進行修改源碼,本人不建議

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.