Warning: org.json.me.JSONArray: can't find referenced class java.lang.StringBuilder

半世苍凉 提交于 2019-12-13 03:49:10

问题


Warning: org.json.me.JSONArray: can't find referenced class java.lang.StringBuilder

I have checked all java file of json.me but in that no java.lang.StringBuilder is used

I got this warning when I am compiling my j2me project.

How to remove this warning from project. I got this json.me from this link Download link of json.me

Please give me solution about that. Thanks


回答1:


java.lang.StringBuilder is found in the JDK. I think StringBuffer is available in Java ME. Use that instead.

Also, I checked the code from the link provided, I see no reference to StringBuilder but I see references to StringBuffer.




回答2:


I encountered this error learning j2me right now. Fixed it by adding a compiler flag: 'javac -source 1.4 ....' .

The reason is, Java 1.5+ uses StringBuilder which replaces StringBuffer. But JavaME implementation doesn't have the StringBuilder, it requires using the old StringBuffer for the same operations. So compile your J2ME class as Java 1.4 so it uses the old method.



来源:https://stackoverflow.com/questions/5259174/warning-org-json-me-jsonarray-cant-find-referenced-class-java-lang-stringbuil

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!