Not sure if I can answer your question, but [jnim](https://github.com/vegansk/jnim) allows bridging to java in a nice automagical way.
- Calling Nim compiled to dll from Java programs? alexsad
- Re: Calling Nim compiled to dll from Java programs? yglukhov