No description
Find a file
2025-08-19 23:03:59 +02:00
.github/workflows Some fixes for newer nim (#75) 2023-04-28 17:05:06 +03:00
jnim Fixes #78 2025-06-28 22:10:44 +02:00
tests Fixes #78 2025-06-28 22:10:44 +02:00
.gitignore Merge jnim with the new API 2016-06-27 15:36:18 +06:00
jnim.nim jexport: implement -d:jnimGenDex (#66) 2020-05-13 23:45:21 +03:00
jnim.nimble Bump version to 0.5.3 2025-08-19 23:03:59 +02:00
LICENSE Initial commit 2015-05-05 22:00:30 +03:00
README.md included another path to search into the JAVA_HOME to support openjdk installed from homebrew. Fixed the example in the README based on the 'test_example.nim' (#77) 2025-02-02 20:03:15 +01:00

jnim - JNI library for Nim language Build Status nimble

Native language integration with Java VM has never been easier!

import jnim

# Import a couple of classes
jclass java.io.PrintStream of JVMObject:
  proc println(s: string)

jclass java.lang.System of JVMObject:
  proc `out`: PrintStream {.prop, final, `static`.}

# Initialize JVM
initJNI()

# Call!
System.`out`.println("This string is printed with System.out.println!")

Overview

The list of the main features:

  • API splitted in two parts: low and high level.
  • It supports Java inheritance and generics.

The documentation is coming soon. Now you can look the examples in the tests directory. For example, tests/test_java_lang.nim and tests/test_java_util.nim shows how to use high level API.

If you want to run the tests, use nimble test command.

Installation

nimble install jnim

Thanks

  • The current version of the library is a complete rewrite done by @vegansk.
  • Also thanks a lot to all the contributors