很莫名的出现android HashSet_jni.h错误,查了一下基本上锁定是java版本的问题,尝试切换java版本无果,参考:http://www.cnblogs.com/rainduck/p/3718227.html
卸载java重新安装还是一样。
这里记录一下重装jdk1.6的过程
1. 安装
http://www.cnblogs.com/haio/p/7244184.html
2. 配置
update-alternatives --install /usr/bin/java java /usr/local/share/jvm/jdk1.6.0_45/bin/java 1888
参考:http://blog.csdn.net/xxy0118/article/details/73733136
最后正确答案:
I have configed my javap but noting change for this error. My enviornment is (ubuntu15.04, python2.7.6, java1.6.0_45, gcc4.8.2) So I change "external/chromium_org/base/android/jni_generator/jni_generator.py", which remove the error.
diif as follows: (indent for "def MultipleReplace" is same with "class InlHeaderFileGenerator" )
--- a/base/android/jni_generator/jni_generator.py
+++ b/base/android/jni_generator/jni_generator.py
@@ -555,18 +555,24 @@ class JNIFromJavaSource(object):
contents)
return JNIFromJavaSource(contents, fully_qualified_class)
+def MultipleReplace(string, rep_dict):
+ pattern = re.compile("|".join([re.escape(k) for k in rep_dict.keys()]), re.M)
+ return pattern.sub(lambda x: rep_dict[x.group(0)], string)
class InlHeaderFileGenerator(object):
"""Generates an inline header file for JNI integration."""
def __init__(self, namespace, fully_qualified_class, natives,
called_by_natives):
- self.namespace = namespace
- self.fully_qualified_class = fully_qualified_class
+# self.namespace = namespace
+# self.fully_qualified_class = fully_qualified_class
+ self.namespace = MultipleReplace(namespace, {'<E>':''})
+ self.fully_qualified_class = MultipleReplace(fully_qualified_class, {'<E>':''})
self.class_name = self.fully_qualified_class.split('/')[-1]
self.natives = natives
self.called_by_natives = called_by_natives
- self.header_guard = fully_qualified_class.replace('/', '_') + '_JNI'
+# self.header_guard = fully_qualified_class.replace('/', '_') + '_JNI'
+ self.header_guard = MultipleReplace(fully_qualified_class, {'/':'_', '<E>':''}) + '_JNI'
def GetContent(self):
"""Returns the content of the JNI binding file."""