1

I made a sample POC for integration of j2objc following http://j2objc.org/docs/Xcode-Build-Rules.html#adding-a-j2objc-build-rule. My POC works great but what I don't understand is I haven't added libz.dylib in Link phase and still it's working fine.By the way, I didn't add libz because I didn't know where to point to. As suggested on some other post copying libz.dylib from /usr/lib, didn't help. My POC is at https://github.com/vipu1212/MyConverter.

Divyansh Singh
  • 390
  • 4
  • 16

1 Answers1

1

Your app doesn't have any references to java.util.zip classes, which depend on libz. It doesn't hurt anything to have an unreferenced library, so j2objc examples list all libraries its runtime depends upon to avoid link errors showing up as new developers experiment with it.

tball
  • 1,984
  • 11
  • 21
  • Thanks :) I have added libz.dylib from /usr/lib but am unable to use methods that use or return JavaUtilArrayList or similar JavaUtil classes. Where did I mess up ? – Divyansh Singh Mar 29 '16 at 13:01
  • All j2objc apps need to link with libjre_emul.a, as that library defines JRE classes like java.util.ArrayList. As described in the Update the Build Settings section of that page, that means adding a -ljre_emul flag, and updating the Library Search Paths to include the j2objc distribution's lib/ directory. – tball Mar 31 '16 at 02:53