khkarens
khkarens

Reputation: 1365

Failed to locate method JNI_GetCreatedJavaVMs in the libjvm.dylib (Mac OS)

I am trying to embed java virtual machine in my program but I libjvm.dylib lacks JNI_GetCreatedJavaVMs.

The program works fine both on Windows and on Linux platforms. However, when running on Mac OS I'm getting:

Failed to locate method JNI_GetCreatedJavaVMs in the shared library libjvm.dylib

exception.

I use libjvm.dylib located in /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Libraries directory.

I think the issue is in using the wrong libjvm however, I was unable to find it in other directories.

I'd be happy to be pointed to the right path of libjvm.

thanks in advance, karen.

Upvotes: 2

Views: 6293

Answers (2)

Peter Quiring
Peter Quiring

Reputation: 1706

Don't use libjvm.dylib if trying to use Oracle JRE. It will cause MacOS to popup a window asking the user to install Java6 (which most users will not have installed). Instead use libjli.dylib. It has the same functions but will bypass Apple's popup warning. Then just package the JRE with your app.

Upvotes: 0

khkarens
khkarens

Reputation: 1365

The JNI_GetCreatedJavaVMs as well as other JVM functions are located in JavaVM file, which can be found in /System/Library/Frameworks/JavaVM.framework/ directory.

Upvotes: 1

Related Questions