1

I want to convert a Json String to an object, without out a library. The reason is that I want to convert the Java code with J2Objc into a Objective-C file. And J2Objc doesn't allow libraries as far as I know. Does anyone know an answer to this question?

Thank you!

user6586661
  • 432
  • 1
  • 11
  • 24

1 Answers1

1

J2Objc does actually support libraries, as explained in the docs. The are plugins available for eclipse, maven and gradle that handle everything for you.

Todd Sewell
  • 1,444
  • 12
  • 26
  • Okay, thanks. But when I add the library as an internal, I get "The import com.google.gson.Gson cannot be resolved". – user6586661 Nov 20 '16 at 15:18
  • What build system are you using? What is your full build-script/file whatever? – Todd Sewell Nov 20 '16 at 15:20
  • I am using MacOS and try to transalte it with the terminal, not the eclipse plugin. And my file is just a normal Java file with an gson implementation. I have tried to put it in the lib directory and then I tried to put it on the same level as the Java file. – user6586661 Nov 20 '16 at 15:32
  • I really recommend you to switch to a real build system eg. gradle, it will make your life a lot easier. I don't know how to get J2Objc to translate the libraries using the command line. – Todd Sewell Nov 20 '16 at 15:36
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/128571/discussion-between-todd-sewell-and-user6586661). – Todd Sewell Nov 20 '16 at 15:44