Facilitating the spread of knowledge and innovation in professional software development



Choose your language

InfoQ Homepage News Google’s J2ObjC 1.0 Translates Java into Objective-C

Google’s J2ObjC 1.0 Translates Java into Objective-C

This item in japanese


J2ObjC is an open source tool created by Google to translate Java code into corrresponding Objective-C code that can be run on iOS. The idea is to reuse Java business code between Android, web and iOS. For the web the translation is done with GWT. This tool does not deal with UI code which needs to be written separately for each platform.

We announced J2ObjC back in 2012 when it was an alpha release, presenting some details on how it works. Slowly, J2ObjC has reached the stable version 1.0, being used by several mobile applications ported by Google for iOS: Inbox, Calendar, Docs, Sheets, Slides and Google My Business. In the meantime, J2ObjC has been upgraded from using Java 6 to Java 7 and 8, their intent being to “support the current and previous major releases of Java, iOS, and Xcode,” according to Tom Ball, a Google Engineer working on the project. J2ObjC is integrated with JUnit, Mockito, Gradle and Maven.  It also supports embedding Objective-C code into Java code through native methods.

When asked how much of Java 8 is supported, Ball told us:

That depends how "Java 8" is defined. :-) We added support for the new Java 8 language features like lambda expressions and method references; however, since our JRE runtime is based on Android's libcore library, we don't yet support any of the new APIs introduced in Java 8. We plan on regularly syncing with the libcore team, so all Java 8 support they add will then shortly added to J2ObjC's runtime.

Regarding future development, Ball added:

J2ObjC is primarily a build tool, so all our future plans are driven by the needs of the app developers who use it. What we're currently hearing is that they need us to continue supporting new iOS features as soon as Apple releases them, better Swift interoperability, Java 8 API support, better tool integration, and reduced build times. As compiler engineers, we're also always focused on optimizing generated code and fixing reported bugs quickly.

J2ObjC has been licensed under the Apache License 2.0.

We need your feedback

How might we improve InfoQ for you

Thank you for being an InfoQ reader.

Each year, we seek feedback from our readers to help us improve InfoQ. Would you mind spending 2 minutes to share your feedback in our short survey? Your feedback will directly help us continually evolve how we support you.

Take the Survey

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p


Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.