From d054f4f4dc278b0b65247bff12d6a30418c34164 Mon Sep 17 00:00:00 2001 From: William R Clark Date: Wed, 4 Oct 2017 14:54:59 -0400 Subject: [PATCH 1/4] Bind OSX to Soft Link containing Java Library. Allow portable binding with Electron. --- binding.gyp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index d323a05b..1e757b46 100644 --- a/binding.gyp +++ b/binding.gyp @@ -135,8 +135,8 @@ '<(javahome)/include/darwin' ], 'libraries': [ - '-L<(javahome)/jre/lib/server', - '-Wl,-rpath,<(javahome)/jre/lib/server', + '-L/Library/Application\ Support/ExportData/javaLocation/jre/lib/server', + '-Wl,-rpath,/Library/Application\ Support/ExportData/javaLocation/jre/lib/server', '-ljvm' ], }, From 52637599f09c6d8cce214c1581a229df80670105 Mon Sep 17 00:00:00 2001 From: William R Clark Date: Wed, 4 Oct 2017 15:12:10 -0400 Subject: [PATCH 2/4] Update usage doc. --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 268e34d1..b0d77c46 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,17 @@ Notes: ### Installation OSX -* If you run into strange runtime issues, it could be because the Oracle JDK does not advertise itself as available for JNI. See [Issue 90](https://github.com/joeferner/node-java/issues/90#issuecomment-45613235) for more details and manual workarounds. If this does occur for you, please update the issue. +PREREQUISITES: + +* OSX JDK needs JNI feature enabled. +Run (https://gist.github.com/pudquick/349f063c242239952a2e#file-modify_java-py) to guarantee all JDKs have JNI enabled. + +* Add a symlink to your JDK. +cd /Library/Application Support/ExportData/ +sudo ln -s /Library/Java/JavaVirtualMachines//Contents/Home javaLocation + +where JDK-VERSION is the version of the JDK you wish to use. + ### Installation Windows From a320bc9b6070c9bd607b4e4cc068caf36e340e41 Mon Sep 17 00:00:00 2001 From: William R Clark Date: Thu, 5 Oct 2017 14:55:28 -0400 Subject: [PATCH 3/4] Update doc. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b0d77c46..b482d5db 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,10 @@ PREREQUISITES: Run (https://gist.github.com/pudquick/349f063c242239952a2e#file-modify_java-py) to guarantee all JDKs have JNI enabled. * Add a symlink to your JDK. +```bash cd /Library/Application Support/ExportData/ sudo ln -s /Library/Java/JavaVirtualMachines//Contents/Home javaLocation +``` where JDK-VERSION is the version of the JDK you wish to use. From 76b359657446e648396f5ebd434adaf70a4fcbe5 Mon Sep 17 00:00:00 2001 From: William R Clark Date: Thu, 5 Oct 2017 15:22:19 -0400 Subject: [PATCH 4/4] Explicit mkdir instructions. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b482d5db..95ff4d84 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Run (https://gist.github.com/pudquick/349f063c242239952a2e#file-modify_java-py) * Add a symlink to your JDK. ```bash +sudo mkdir /Library/Application Support/ExportData/ cd /Library/Application Support/ExportData/ sudo ln -s /Library/Java/JavaVirtualMachines//Contents/Home javaLocation ```