Convert java 5 code using generics to code that can run on a J2ME device?

偶尔善良 提交于 2019-12-06 09:03:54

问题


Are there any solutions or tools that transform java 5 code that uses all the new java 5 features(generics, autoboxing, varargs, static imports) into code that can run on a J2ME device? I am particularly interested in handling generics - the other features are nice to have but not mandatory.

I need source code as the result of this conversion as this will be compiled using a custom compiler. (I cannot use bytecode manipulation(ala retroweaver))


回答1:


Compiling with the regular javac and targeting an older JVM will give you proper bytecode for generics at least.

If you really need source it's probably possible, though strange, to compile to bytecode and then decompile back to source.



来源:https://stackoverflow.com/questions/436847/convert-java-5-code-using-generics-to-code-that-can-run-on-a-j2me-device

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