Building J2ObjC


  • Apple Mac OS X system
  • Latest version of Xcode
  • Apache Maven
  • (Recommended but not required) Google Protocol Buffer source

Building J2ObjC

To build from a command-line in a Terminal window, run:

# Build just the translator and libraries
make dist

# Build the full distribution (including frameworks)
make frameworks

# Build the protocol buffer compiler and runtime for J2ObjC
make protobuf_dist

# Build everything that is included in the project's distribution bundles
make all_dist

Optional Setup for Protocol Buffers

The J2ObjC Protocol Buffers compiler and runtime require that Protocol Buffers 3.3.0 be installed:

  • Download the source code from the Protocol Buffers 3.3.0 release.
  • Follow the C++ installation instructions from the README. Pay attention to the --prefix option to specify your install location.
  • Define the PROTOBUF_ROOT_DIR environment variable to point to your Protocol Buffers install location.

Testing J2ObjC

To test from a command-line in a Terminal window, run:

# Run translator and library unit tests
make test

# Run all unit tests, including for protocol buffers
make test_all

Cleaning/Resetting a Build

# Remove all files generated by the build
make clean

Parallel Builds

The J2ObjC build supports parallel builds, which are specified using the -j<n> flag, where n is the maximum number of concurrent tasks. The maximum depends on how fast/powerful your system is; we suggest starting with -j4. Increase the number to shorten build times if your system can handle it, and decrease it if make fails with system errors.