Can Google's j2objc process and convert binary JAR files?

人盡茶涼 提交于 2020-01-04 05:08:11

问题


I'm looking to get started with mobile development (specifically iOS), and while I'm usually pretty good at learning languages, Objective-C confounds me at almost every turn. So, looking at j2objc (because I already know Java), I think it might fit the bill in terms of what I'm looking for.

My question, though, is pretty simple: can the converter properly handle a situation where my source code references, say, Apache Commons code in a binary-only (bytecode) JAR file?


回答1:


No, j2objc requires source code (it uses the front-end of Eclipse's compiler). The RoboVM project works from class files, though.




回答2:


J2objc is good for writing business logic only once. If you plan to write an app for Android, iOS and GWT, use it. But you will always need to write native code for UI, network and other specific platform stuff (Camera, Geoloc., etc.). If you plan to become a mobile development expert, my advice is to start learning Objective-c right now (I was just like you 2 years ago. I invested time to learn Objective-c and it's the only way to become a cross-platform mobile geek :-). I started with this book : Programming in Objective-C 2.0 (Stephen G. Kochan). Good luck !




回答3:


No: j2objc requires source code. However j2objc allows transpiling source code that references .jar files. However the jar files with .class files wont be transpiled




回答4:


I am coming from Java background as well and learned Objective-C by myself (and taught it as well).

If you really want to develop mobile apps for iOS the best thing is to invest in learning Objective-C. J2ObjC is not sufficient to create iOS apps since it does not provide UI support and it is not stable yet (between alpha and beta quality)

J2ObjC does not provide any sort of platform-independent UI toolkit, nor are there any plans to do so in the future.

Objective-C looks strange in the beginning, especially for people with Java or C/C++ background, but once learn it; you will start to appreciate the language.

This is an excellent course to get you started and apple provides excellent resources to learn iOS development and Objective-C.

I strongly doubt that any language translation tool ,e.g. J2ObjC, will be sufficient to build good iOS apps.



来源:https://stackoverflow.com/questions/14780991/can-googles-j2objc-process-and-convert-binary-jar-files

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