Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work on OS X 10.11 El Capitan, but installs correctly #223

Closed
clns opened this issue Jun 9, 2015 · 5 comments
Closed

Doesn't work on OS X 10.11 El Capitan, but installs correctly #223

clns opened this issue Jun 9, 2015 · 5 comments

Comments

@clns
Copy link

clns commented Jun 9, 2015

After installing OS X 10.11 Beta, calling java methods on the java object doesn't work anymore, and a popup opens saying "This application requires the legacy Java SE 6 runtime which is
unavailable for this version of OS X.
".

However node-java installs successfully, the only thing I noticed is this message:

2015-06-09 17:09:03.971 xcodebuild[7059:336822] [MT] PluginLoading: Required plug-in 
compatibility UUID E969541F-E6F9-4D25-8158-72DC3545A6C6 for plug-in at path 
'~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SparkInspectorXcodePlugin.xcplugin' 
not present in DVTPlugInCompatibilityUUIDs

I also checked find-java-home and it's finding the correct jdk:

$ node findJavaHome.js
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
@jimlloyd
Copy link
Collaborator

jimlloyd commented Jun 9, 2015

I left a comment on stackoverflow, but here it is again:

Please try installing the runtime as discussed here: https://discussions.apple.com/thread/6604985.
Let's hope this installer still works with El Capitan.

@clns
Copy link
Author

clns commented Jun 9, 2015

Unfortunately that didn't work. I first added the question on SO because I am not sure if the issue is related to (or can be fixed in) node-java, since I noticed the same error with PhpStorm. However I mostly care about node-java to work.

@clns
Copy link
Author

clns commented Jun 9, 2015

A working solution can be found here.

In short, Oracle's JDK doesn't advertise itself as supporting JNI, so even though node-java links to JAVA_HOME correctly, when the JNI_CreateJavaVM call is made the system sees that the linked JDK doesn't "support" JNI and switches to Java 6 instead.

To fix this I manually enabled JNI by editing
/Library/Java/JavaVirtualMachines/<version>.jdk/Contents/Info.plist and adding JNI as an option in JVMCapabilities:

<key>JVMCapabilities</key>
<array>
    ...
    <string>JNI</string>
</array>

@junqdu
Copy link

junqdu commented Mar 13, 2017

@clns any idea why JDK doesn't advertise itself as supporting JNI?

@clns
Copy link
Author

clns commented Mar 14, 2017

@junqdu No idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants