http://j2objc.org/
Java to iOS Objective-C translation tool and runtime.
A. 环境变量:
vim .bash_profile & source .bash_profile
export J2OBJC_HOME=/Users/oukagaku/j2objc-dist
PATH="${J2OBJC_HOME}:${PATH}"
export PATH
B. 主要相关步骤
j2objc HelloWorld.java
j2objcc -c HelloWorld.m
j2objcc -o hello HelloWorld.o
运行 ./hello HelloWorld
Step 01. 写一个输出的Java类
Step 02. Java 转换OC: j2objc HelloWorld.java
Step 03. 编译: j2objcc -c HelloWorld.m
Step 04. 运行: j2objcc -o hello HelloWorld.o