J2OBJC(1)

NAME
j2objc - translate Java source files to Objective-C

SYNOPSIS
j2objc [ options ] file1.java ...

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

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 used by source files

-source release
    Provide source compatibility with specified release

-g  Generate Java source debugging support

-l, --list
    List files that are translated

-v, --verbose
    Output messages about what the translator is doing

-Werror
    Make all warnings into errors

-h, --help
    Print this message.

TRANSLATION OPTIONS

--add-reads
    Option forwarded directly to the Java compiler (see javac help for details).

--allow-inherited-constructors
    Don't issue compiler warnings when native code accesses inherited constructors.

--build-closure
    Translate dependent classes if out-of-date.

--class-properties
    Generates class properties for static variables and enum constants.

--dead-code-report file
    Specify a ProGuard usage report for dead code elimination.

--doc-comments
    Translate Javadoc comments into Xcode-compatible comments.

--doc-comment-warnings
    Report warnings when translating Javadoc comments.

-external-annotation-file
    Specify the most common annotations that affect transpilation in a Java Annotation Index File (format defined by the Checker Framework).

-g:none
    Do not generate Java source debugging support

-g:relative
    Generate Java source debugging support with relative paths

--generate-deprecated
    Generate deprecated attributes for deprecated methods, classes, and interfaces.

-J<flag>
    Pass <flag> directly to the Java runtime.

--mapping file
    Add a method mapping file.

--no-class-properties
    Do not generate class properties for static variables and enum constants. --no-extract-unsequenced Don't rewrite expressions that would produce unsequenced modification errors.

--no-nullability
    Do not generate Objective-C nullability annotations. --no-package-directories Generate output files to specified directory, without creating package sub-directories.

--no-segmented-headers
    Do not generate headers with guards around each declared type.

--no-wrapper-methods
    Do not generate Objective-C wrapper methods for constructors and static methods. (J2ObjC generates C functions for these kinds of executables)

--nullability
    Converts Nullable and Nonnull annotations to Objective-C.

--patch-module
    Option forwarded directly to the Java compiler (see javac help for details).

--prefix package=prefix
    Substitute a specified prefix for a package name.

--prefixes file
    Specify a properties file with prefix definitions.

--preserve-full-paths
    Generates output files with the same relative paths as the input files.

-processor class[,class...]
    Names of the annotation processors to run; bypasses default discovery process.

-processorpath path
    Specify where to find annotation processors.

--reserved-names file
    Avoids redefining identifiers present in system headers.

--static-accessor-methods
    Generates accessor methods for static variables and enum constants.

--strip-gwt-incompatible
    Removes methods that are marked with a GwtIncompatible annotation, unless its value is known to be compatible.

--strip-reflection
    Do not generate metadata needed for Java reflection.

--swift-friendly
    Generate code that facilitates Swift importing (equivalent to --class-properties --nullability --swift-enum).

--no-swift-enums
    Disables generation of Swift-like enum case names.

--system
    Option forwarded directly to the Java compiler (see javac help for details).

-t, --timing-info
    Print time spent in translation steps and total execution time.

--timing-info:all
    Print time spent in translation steps and total execution time.

--timing-info:total
    Print total execution time.

--timing-info:none
    Do not print timing information (default).

-use-arc
    Generate Objective-C code to support Automatic Reference Counting (ARC).

-use-reference-counting
    Generate Objective-C code to support iOS manual reference counting (default).

-version
    Version information.

-x language
    Specify what language to output. Possible values are objective-c (default) and objective-c++.

-X  Displays information about nonstandard options and exits.

NONSTANDARD OPTIONS

-Xbootclasspath:path
    Boot path used by translation (not the tool itself).

-Xlint
    Enable recommended warnings. In this release, all available warnings are recommended.

-Xlint:none
    Disable all warnings not mandated by the Java Language Specification.

-Xlint:-xxx
    Disable warning xxx, where xxx is one of the warning names supported for -Xlint:xxx, below.

-Xlint:cast
    Warn about unnecessary and redundant cast expressions.

-Xlint:deprecation
    Warn about the use of deprecated items.

-Xlint:dep-ann
    Warn about items that are documented with an @deprecated Javadoc comment, but do not have a @Deprecated annotation.

-Xlint:empty
    Warn about empty statements.

-Xlint:fallthrough
    Check switch blocks for fall-through cases and provide a warning message for any that are found.

-Xlint:finally
    Warn about finally clauses that cannot complete normally.

-Xlint:rawtypes
    Warn about unchecked operations on raw types.

-Xlint:serial
    Warn about missing serialVersionUID definitions on serializable classes.

-Xlint:static
    Warn about serial methods called on instances.

-Xlint:unchecked
    Give more detail for unchecked conversion warnings that are mandated by the Java Language Specification.

-Xlint:varargs
    Warn about unsafe usages of variable arguments (varargs) methods, in particular, those that contain non-reifiable arguments.

-Xno-jsni-warnings
    Warn if JSNI (GWT) native code delimiters are used instead of OCNI delimiters.

SEE ALSO
j2objcc(1)

The full documentation for j2objc is maintained on the project site at http://j2objc.org/.