android 编译 oserror,jdk/java版本与Android源码编译中的错误

错误一:javap未指向有效的java版本

69c5a8ac3fa60e0848d784a6dd461da6.pngTraceback (most recent call last):

File"../../base/android/jni_generator/jni_generator.py", line 1065, in sys.exit(main(sys.argv))

File"../../base/android/jni_generator/jni_generator.py", line 1061, inmain

options.optimize_generation)

File"../../base/android/jni_generator/jni_generator.py", line 996, inGenerateJNIHeader

jni_from_javap=JNIFromJavaP.CreateFromClass(input_file, namespace)

File"../../base/android/jni_generator/jni_generator.py", line 507, inCreateFromClass

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_childraisechild_exception

OSError: [Errno2] No such file ordirectory

make:*** [/home/odexcide/android-4./out/target/product/generic/obj/GYP/shared_intermediates/ui/gl/jni/Surface_jni.h] Error 1make:*** Waiting for unfinished jobs..

69c5a8ac3fa60e0848d784a6dd461da6.png

原因 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

69c5a8ac3fa60e0848d784a6dd461da6.pngout/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.cc

In file includedfrom 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 ‘

out/target/product/mx3/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:26:17: error: expected initializer before ‘

out/target/product/mx3/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:29:22: error: expected ‘{‘ before ‘

out/target/product/mx3/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:29:22: error: expected unqualified-id before ‘

external/chromium_org/content/common/android/hash_set.cc:30:1: error: expected ‘}‘at end of input

cc1plus: all warnings being treated as errors

make:*** [out/target/product/mx3/obj/STATIC_LIBRARIES/content_content_common_gyp_intermediates/content/common/android/hash_set.o] 错误 1make:*** 正在等待未完成的任务....

69c5a8ac3fa60e0848d784a6dd461da6.png

这可能是由于java版本不符,请安装相应版本的jdk。

此外, 如果尚未解决,可参考此帖进行修改源码,本人不建议

原文:http://www.cnblogs.com/rainduck/p/3718227.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值