Great with Java but not Objective C for iOS? Google hopes to win you over with its new open source release of J2ObjC, a translator that converts Java source code into Objective-C source for iPhone and iPad applications.

Google Java to iOS TranslatorJ2ObjC enables Java code to be part of an iOS application’s build, as no editing of the generated files is necessary. The goal is to write an application’s non-UI code (such as data access, or application logic) in Java, which can then be shared by Android apps, web apps (using GWT), and iOS.

J2ObjC is not a Java emulator, but instead converts Java classes to Objective-C classes that directly use the iOS Foundation Framework. It supports the full Java 6 language and most of its runtime features that are required by client-side application developers, including exceptions, inner and anonymous classes, generic types, threads and reflection. JUnit test translation and execution is also supported. J2ObjC can be used with most build tools, including Xcode and Make.

For instructions on how to use the tool and check out the source code, visit the J2ObjC project page. The site also has detailed design docs for anyone interested in how the translator works.

Source: Google Open Source Blog