Skip to content
A Java to iOS Objective-C translation tool and runtime.
Java Objective-C C Makefile C++ Objective-C++ Other
Branch: master
Clone or download
tomball and Copybara-Service Load CoreFoundation header before Foundation header, to reduce chance…
… of circular build dependencies.

PiperOrigin-RevId: 294532344
Latest commit afd4d01 Feb 11, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
annotations Issue #1100: removed obsolete SUFFIXES rules from make files. Oct 7, 2019
cycle_finder Annotation support: update scenelib library version used. Oct 11, 2019
doc
examples Restored examples/protobuf directory. Jan 17, 2020
guava Issue #1100: removed obsolete SUFFIXES rules from make files. Oct 7, 2019
inject/javax_inject Issue #1100: removed obsolete SUFFIXES rules from make files. Oct 7, 2019
java_deps Updates protocol buffers dependency to 3.11.1 Dec 12, 2019
jre_emul Load CoreFoundation header before Foundation header, to reduce chance… Feb 11, 2020
jsr305 Project health: move the jsr305 source list to the Makefile. Oct 25, 2019
junit Issue #1100: removed obsolete SUFFIXES rules from make files. Oct 7, 2019
make Continuous build: forward J2OBJC_ARCHS to make sub-processes, log arc… Feb 1, 2020
protobuf
scripts Change only for testing sync to repo. Aug 15, 2019
testing Issue #1100: removed obsolete SUFFIXES rules from make files. Oct 7, 2019
translator Translator improvements: remove experimental flag: -Xrename-package-p… Nov 18, 2019
tree_shaker Issue #1100: removed obsolete SUFFIXES rules from make files. Oct 7, 2019
xalan Issue #1181: added Xalan library's META-INF/services files as framewo… Jan 17, 2020
.gitattributes Include git config files in public source. Jun 23, 2017
.gitignore Ignore IntelliJ IDEA files Dec 29, 2016
AUTHORS Deleted plain-text README. Feb 5, 2014
BUILD.dist
CONTRIBUTING.md Updated README, added CONTRIBUTING page. Feb 5, 2014
INSTALL Update build requirements and tool links Dec 7, 2015
LICENSE java.time: adding classes with android.icu dependencies removed. Nov 19, 2018
Makefile Project health: regression tests transpile code so they depend on the… Nov 23, 2019
README.md Project health: clarify supported JDK versions. Oct 1, 2019
WORKSPACE.dist Bazel support: add rules_java repo to examples/Contacts/WORKSPACE. Jul 15, 2019

README.md

J2ObjC: Java to Objective-C Translator and Runtime

Project site: https://j2objc.org
J2ObjC blog: https://j2objc.blogspot.com
Questions and discussion: https://groups.google.com/group/j2objc-discuss

What J2ObjC Is

J2ObjC is an open-source command-line tool from Google that translates Java source code to Objective-C for the iOS (iPhone/iPad) platform. This tool enables Java source to be part of an iOS application's build, as no editing of the generated files is necessary. The goal is to write an app's non-UI code (such as application logic and data models) in Java, which is then shared by web apps (using GWT), Android apps, and iOS apps.

J2ObjC supports most Java language and runtime features 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 is currently beta quality. Several Google projects rely on it, but when new projects first start working with it, they usually find new bugs to be fixed. If you run into issues with your project, please report them!

What J2ObjC isn't

J2ObjC does not provide any sort of platform-independent UI toolkit, nor are there any plans to do so in the future. We believe that iOS UI code needs to be written in Objective-C, Objective-C++ or Swift using Apple's iOS SDK (Android UIs using Android's API, web app UIs using GWT, etc.).

J2ObjC cannot convert Android binary applications. Developers must have source code for their Android app, which they either own or are licensed to use.

Requirements

License

This library is distributed under the Apache 2.0 license found in the LICENSE file. The protocol buffers library is distributed under the same BSD license as Google's protocol buffers. See its README and LICENSE.

Running on GNU/Linux

To build and run on GNU/Linux, install the Darling project, then following its Compile and Run a Program example. Please note that j2objc is only supported on iOS/macOS.

You can’t perform that action at this time.