Hi i would like to convert my java code to objective c from terminal with j2objc.
I need to set below flag in terminal. (jre_emul is J2ObjC's JRE emulation library).
-ljre_emul
So when compile j2objc should compile with the JRE emulation lib.
$ j2objc Hello.java
How can i do it with terminal only without Xcode?
Source reference https://github.com/google/j2objc/wiki/Xcode-Build-Rules
You jumped ahead in the wiki, as the Getting Started page is for a command-line:
https://github.com/google/j2objc/wiki/Getting-Started.
$ j2objc Hello.java # translates to Hello.m, Hello.h
$ j2objcc Hello.m # compiles, links to a.out
$ ./a.out Hello # run binary, specify the class name (like java command)
Hello, world
The j2objc and j2objcc commands are scripts, so you can also use them to see what defaults are used. For example, the "-ljre_emul" flag is set by j2objcc.
There are man pages for all commands, so running "man -M /man j2objcc" will show its documentation.