The j2objc tool translates specified Java source files into either Objective-C or Objective-C++ sources for use in an iOS application.

j2objc [ options ] file1.java ...

The following options are supported. For options that take a path, multiple directories and jar files are separated by a ':', like is done with the java and javac commands.

Common options

-sourcepath <path>
Specify where to find input source files.
-classpath <path>
Specify where to find user class files.
-d <directory>
Specify where to place generated Objective-C files.
-encoding <encoding>
Specify character encoding of source files (UTF-8 default).
-source <release>
Provide source compatibility with specified release.
Generate debugging support.
-q, --quiet
Do not print status messages.
-v, --verbose
Output messages about what the translator is doing.
Make all warnings into errors.
-h, --help
Print this message.

Translation options

The maximum number of source files that are translated together. Batching speeds up translation, but requires more memory.
Translate dependent classes if they are out-of-date (likejavacdoes).
--dead-code-report <file>
Specify a ProGuard usage report for dead code elimination.
Issue compiler warnings when native code accesses inherited constructors.
Translate Javadoc comments into Xcode-compatible comments.
Don't rewrite expressions that would produce unsequenced modification errors.
Generate deprecated attributes for deprecated methods, classes and interfaces.
Pass a Java <flag>, such as-Xmx1G, to the system runtime.
--mapping <file>
Add a method mapping file.
Don't emit class methods for static Java methods (static methods are always converted to functions).
Don't create directories for Java packages when generating files.
Generates headers with guards around each declared type. Useful for breaking import cycles.
Converts Nullable and Nonnull annotations to Objective-C annotations.
--prefix <package=prefix>
Substitute a specified prefix for a package name.
--prefixes <file>
Specify a properties file with prefix definitions.
Generates output files with the same relative paths as the input files.
-processor <class1>[,<class2>...]
Names of the annotation processors to run; bypasses default discovery process.
-processorpath <path>
Specify where to find annotation processors.
Generates accessor methods for static variables and enum constants.
Removes methods that are marked with aGwtIncompatibleannotation, unless its value is known to be compatible.
Do not generate metadata needed for Java reflection (note: this will significantly reduce reflection support).
Generate c