Skip to content

Commit 1142ef9

Browse files
authored
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)
1 parent 7529997 commit 1142ef9

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ import jnim
88
# Import a couple of classes
99
jclass java.io.PrintStream of JVMObject:
1010
proc println(s: string)
11+
1112
jclass java.lang.System of JVMObject:
1213
proc `out`: PrintStream {.prop, final, `static`.}
1314
15+
# Initialize JVM
16+
initJNI()
17+
1418
# Call!
1519
System.`out`.println("This string is printed with System.out.println!")
1620
```

jnim/private/jvm_finder.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ proc findJvmInPath(p: string): string =
2222
"jre/lib/libjvm.dylib",
2323
"jre/lib/amd64/jamvm/libjvm.so",
2424
"jre/lib/amd64/server/libjvm.so",
25-
"lib/server/libjvm.so"
25+
"lib/server/libjvm.so",
26+
"libexec/lib/server/libjvm.so",
2627
]
2728
for lib in libs:
2829
let lp = p / lib

tests/test_example.nim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ jclass java.lang.System of JVMObject:
99

1010
# Initialize JVM
1111
initJNI()
12+
1213
# Call!
1314
System.`out`.println("This string is printed with System.out.println!")

0 commit comments

Comments
 (0)