- Home
- Code Transpilers
- J2ObjC
J2ObjC
What it is
J2ObjC is a free, open-source command-line tool from Google that converts Java source code to Objective-C for iOS. It is intended for sharing non-UI code, such as application logic and data models, across web, Android, and iOS apps. It supports Java exceptions, inner and anonymous classes, generics, threads, and reflection, and can translate and run JUnit tests. The distribution includes static libraries for Guava, JUnit, Mockito, Protocol Buffers, and other Java libraries or Android utility classes. J2ObjC does not provide a shared UI toolkit; iOS interfaces use Objective-C, Objective-C++, or Swift with Apple's iOS SDK. It requires Java source code that the developer owns or is licensed to use, and cannot convert Android binary applications. Requirements are a Mac workstation or laptop, macOS 15 or higher, Xcode 16 or higher, and JDK 21 or higher. Its j2objcc script wraps clang and uses the iOS SDK, while Xcode projects need J2ObjC-specific linker settings. Developers remain responsible for memory management under Objective-C reference counting.
For and against
For
- Free and open source under Apache 2.0.
- Supports a range of Java language features.
- Can translate and run JUnit tests.
- Includes libraries such as Guava and Mockito.
Against
- Requires a Mac, macOS 15+, Xcode 16+, and JDK 21+.
- Does not provide a platform-independent UI toolkit.
- Cannot convert Android binary applications.
- Developers manage memory and may introduce leaks.
The verdict
J2ObjC focuses on reusing Java non-UI code in iOS apps, with support for several Java features and JUnit tests. Its platform requirements and lack of a shared UI toolkit make it a specialized option for developers with compatible source code and build environments.
Who it suits
J2ObjC suits developers who want to reuse Java application logic or data models in iOS projects and have the required Mac, Xcode, and JDK setup. It is not for converting Android binaries or sharing an iOS UI toolkit.
Plans and prices
Free and open source
Apache 2.0 license · Mac workstation with macOS 15 or higher, Xcode 16 or higher, and JDK 21 or higher
Read 7 Oct 2026 · developers.google.com
On the record
- Artifact signing
- The project says some Maven Central artifacts under groupId com.google.j2objc are signed with a published PGP/GPG key.github.com · read 7 Oct 2026
- Build integration
- The j2objcc command-line script wraps clang and uses the iOS SDK, while Xcode projects need J2ObjC-specific linker settings.developers.google.com · read 7 Oct 2026
- Java support
- It supports Java features including exceptions, inner and anonymous classes, generics, threads, and reflection.developers.google.com · read 7 Oct 2026
- Libraries
- The distribution includes static libraries for Guava, JUnit, Mockito, Protocol Buffers, and other Java libraries or Android utility classes.developers.google.com · read 7 Oct 2026
- Linux limitation
- The project states that J2ObjC is supported only on iOS and macOS, while GNU/Linux use requires the Darling project.github.com · read 7 Oct 2026
- Memory management
- J2ObjC uses Objective-C reference counting, and its documentation says developers are responsible for memory management and can introduce leaks.developers.google.com · read 7 Oct 2026
- Requirements
- The listed requirements are a Mac workstation or laptop, macOS 15 or higher, Xcode 16 or higher, and JDK 21 or higher.developers.google.com · read 7 Oct 2026
- 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.developers.google.com · read 7 Oct 2026
- Source code required
- J2ObjC cannot convert Android binary applications; developers need source code they own or are licensed to use.developers.google.com · read 7 Oct 2026
- Support
- The project points users to its issue tracker, Stack Overflow j2objc tag, and Google Groups discussions for help.developers.google.com · read 7 Oct 2026
- Test support
- J2ObjC supports translating and executing JUnit tests.developers.google.com · read 7 Oct 2026
- 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.developers.google.com · read 7 Oct 2026
- What it does
- J2ObjC is an open-source command-line tool from Google that translates Java source code to Objective-C for iOS.developers.google.com · read 7 Oct 2026
The review
J2ObjC translates Java source into Objective-C so developers can carry non-UI logic into iOS apps. It is best suited to teams with Java code they own or are licensed to use and a compatible Mac and Xcode setup. Its focused scope can help reuse application logic, but it does not carry Java-based interfaces to iOS.
Overview
As a Google open-source command-line tool, J2ObjC targets a specific problem: sharing Java application logic and data models across web, Android, and iOS projects. Translating source code rather than Android binaries makes it relevant to teams with access to the underlying Java, not those trying to repurpose a compiled Android app.
The boundary is important. J2ObjC provides no platform-independent UI toolkit; iOS screens still need to be built with Objective-C, Objective-C++, or Swift and Apple's iOS SDK. This is a code-reuse tool, not a shortcut to a cross-platform app.
Key features
Java-to-Objective-C translation
J2ObjC supports Java features such as exceptions, inner and anonymous classes, generics, threads, and reflection. That breadth gives teams a way to retain more existing Java logic, though the resulting iOS code still needs to fit an Xcode project and its linker settings.
Tests and libraries
It can translate and run JUnit tests, which lets teams bring Java test code into the workflow rather than leave it behind during translation. The distribution also includes static libraries for Guava, JUnit, Mockito, Protocol Buffers, and other Java libraries or Android utility classes.
Command-line and memory model
The j2objcc script wraps clang and uses the iOS SDK. That gives developers a command-line path into the native toolchain, but Xcode projects require J2ObjC-specific linker settings. J2ObjC uses Objective-C reference counting, so developers remain responsible for memory management and can introduce leaks.
Pricing
J2ObjC is free and open source under the Apache 2.0 license: free. There is no free trial because the tool is offered as a free plan. The tradeoff is not a paid-tier restriction but the cost of meeting its development requirements and integrating translated code into an iOS build.
The project points users to its issue tracker, the Stack Overflow j2objc tag, and Google Groups discussions for help. Some Maven Central artifacts under the com.google.j2objc groupId are signed with a published PGP/GPG key.
Platforms
J2ObjC targets iOS translation and is supported on iOS and macOS. The listed requirements are a Mac workstation or laptop, macOS 15 or higher, Xcode 16 or higher, and JDK 21 or higher. Although Linux appears among the platform labels, the project says GNU/Linux use requires the Darling project; it is not a substitute for the supported Mac-based iOS workflow.
Who it's for
This is a practical fit for developers maintaining Java application logic or data models across web, Android, and iOS who can build and maintain native iOS UI separately. JUnit support and bundled libraries add value for teams already relying on those Java components.
It is a poor fit for teams seeking one shared UI layer, people without access rights to the Java source, or developers whose workstation and toolchain fall short of the stated Mac, macOS, Xcode, and JDK requirements.
Pros and cons
- Pro: Broad Java feature support can preserve useful non-UI logic across platforms.
- Pro: JUnit translation and bundled libraries support reuse beyond application code alone.
- Con: No shared UI toolkit means iOS interfaces must still be written with Apple's native UI technologies.
- Con: Mac-specific requirements, Xcode linker configuration, and developer-managed reference counting add setup and maintenance work.
- Con: Source code ownership or licensing is required; Android binaries cannot be converted.
Alternatives
For other tools in the category, see Code Transpilers. SWC is a free, open-source Rust-based developer toolchain for teams looking beyond Java-to-Objective-C translation. Choose JSweet when the target is JavaScript rather than iOS's Objective-C.
Brython is another free option. js_of_ocaml suits readers considering a free tool for API, Linux, or web platforms. Skulpt is a free web-platform option, while Transcrypt offers an Apache 2.0-licensed alternative across Linux, macOS, self-hosted, web, and Windows platforms.
TypeScript Playground is a free, browser-based option focused on a single text document; Babel is a free alternative spanning API, Linux, macOS, web, and Windows.
Verdict
Choose J2ObjC if you have Java source worth reusing, need its non-UI logic in an iOS app, and can support the required Mac and Xcode workflow. Its Java and JUnit support make that narrow use case compelling at no cost. Look elsewhere if you need shared interfaces, cannot access the source, or want to avoid native iOS integration and memory-management responsibilities.