Google’s J2ObjC 1.0 Translates Java into Objective-C

| by Abel Avram Follow 5 Followers on Feb 05, 2016. Estimated reading time: 1 minute |

A note to our readers: You asked so we have developed a set of features that allow you to reduce the noise: you can get email and web notifications for topics you are interested in. Learn more about our new features.

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.

Rate this Article

Adoption Stage

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.

Tell us what you think

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

Email me replies to any of my messages in this thread
Community comments

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

Email me replies to any of my messages in this thread

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

Email me replies to any of my messages in this thread


Login to InfoQ to interact with what matters most to you.

Recover your password...


Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.


More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.


Stay up-to-date

Set up your notifications and don't miss out on content that matters to you