Search code examples
javaj2objc

Can j2objc be used for generating Objective C code not for iOS?


We need to convert some Java code to Objective C for MacOS and Linux. While in general Objective C can be compiled on those platforms, the question is - does the code, generated by j2objc, depend on anything specific to iOS, or it can be compiled say on Linux?


Solution

  • Originally, no, since it generates code which depends on the iOS Foundation framework, which requires an iOS SDK license, which restricts SDK use to a Mac. However, with Swift being open-sourced recently with a partial Linux build, that license restriction may change in the future.

    The j2objc project has no current plans to support its use outside of building iOS apps on Macs. Being fully open-sourced, we encourage curious developers to fork the project and focus wherever they wish. As a small engineering team, though, we just don't have the resources to assist.