J2ObjC
developers.google.com
What it is
J2ObjC is Google’s free, open-source command-line tool for translating Java source code into Objective-C for iOS. It is designed for sharing non-UI application logic and data models across web, Android, and iOS projects. Supported Java features include exceptions, inner and anonymous classes, generics, threads, and reflection, and the tool can translate and execute JUnit tests. The distribution contains static libraries for Guava, JUnit, Mockito, Protocol Buffers, and other Java or Android utility libraries. J2ObjC does not provide a platform-independent UI toolkit; iOS interfaces use Objective-C, Objective-C++, or Swift with Apple’s iOS SDK. Developers need source code they own or are licensed to use because Android binaries cannot be converted. Requirements include a Mac workstation, macOS 15 or higher, Xcode 16 or higher, and JDK 21 or higher. The j2objcc script wraps clang and uses the iOS SDK, while Xcode projects need J2ObjC linker settings. Objective-C reference counting leaves memory management to developers.
Spec sheet
- What it does
- J2ObjC is an open-source command-line tool from Google that translates Java source code to Objective-C for iOS.Read 7 Oct 2026 · developers.google.com
- Support
- The project points users to its issue tracker, Stack Overflow j2objc tag, and Google Groups discussions for help.Read 7 Oct 2026 · developers.google.com
- Artifact signing
- The project says some Maven Central artifacts under groupId com.google.j2objc are signed with a published PGP/GPG key.Read 7 Oct 2026 · github.com
- Build integration
- The j2objcc command-line script wraps clang and uses the iOS SDK, while Xcode projects need J2ObjC-specific linker settings.Read 7 Oct 2026 · developers.google.com
- Java support
- It supports Java features including exceptions, inner and anonymous classes, generics, threads, and reflection.Read 7 Oct 2026 · developers.google.com
- Libraries
- The distribution includes static libraries for Guava, JUnit, Mockito, Protocol Buffers, and other Java libraries or Android utility classes.Read 7 Oct 2026 · developers.google.com
- Linux limitation
- The project states that J2ObjC is supported only on iOS and macOS, while GNU/Linux use requires the Darling project.Read 7 Oct 2026 · github.com
- Memory management
- J2ObjC uses Objective-C reference counting, and its documentation says developers are responsible for memory management and can introduce leaks.Read 7 Oct 2026 · developers.google.com
- Requirements
- The listed requirements are a Mac workstation or laptop, macOS 15 or higher, Xcode 16 or higher, and JDK 21 or higher.Read 7 Oct 2026 · developers.google.com
- Shared code
- It is intended to let developers write non-UI code such as application logic and data models in Java for use across web, Android, and iOS apps.Read 7 Oct 2026 · developers.google.com
- Source code required
- J2ObjC cannot convert Android binary applications; developers need source code they own or are licensed to use.Read 7 Oct 2026 · developers.google.com
- Test support
- J2ObjC supports translating and executing JUnit tests.Read 7 Oct 2026 · developers.google.com
- UI limit
- It does not provide a platform-independent UI toolkit, and its documentation says iOS UI should use Objective-C, Objective-C++, or Swift with Apple's iOS SDK.Read 7 Oct 2026 · developers.google.com
Plans and prices
Strong points and limits
Strong points
- Translates Java source to Objective-C
- Supports generics, threads, reflection, and exceptions
- Can translate and execute JUnit tests
- Includes several Java and Android utility libraries
- Command-line workflow integrates with clang and Xcode
Limits
- No platform-independent UI toolkit
- Cannot convert Android binary applications
- Requires macOS 15, Xcode 16, and JDK 21
- Developers remain responsible for memory management
Who it suits
It suits developers sharing Java-based non-UI logic and data models with iOS applications who can work on the listed Mac toolchain.
Verdict
J2ObjC focuses on source-to-source reuse of Java logic in iOS projects. It is less suitable when shared user interfaces or binary-only Android code are required.
Where Specifiction places it
- Code Transpilers#14 of 287.8