Hi, all
I'm integrating the Weka interface into a python project and it comes up with the bug:
Failed to open libjli.dylib.
Traceback (most recent call last):
File "/Users/wyj/opt/anaconda3/lib/python3.9/site-packages/javabridge/jutil.py", line 282, in start_thread
vm.create_mac(args, RQCLS, library_path, libjli_path)
File "_javabridge.pyx", line 709, in _javabridge.JB_VM.create_mac
RuntimeError: Failed to create Java VM. Return code = -1
ERROR:javabridge.jutil:Failed to create Java VM
RuntimeError: Failed to start Java VM
my jdk version is 17.0.9 ,my java file configuration is:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
I have already install the python-weka-wrapper3 and python-javabridge
my python code is:
import javabridge
from weka.classifiers import Classifier
from weka.core import jvm
#sys.path.append("/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/bin/")
#os.environ["JAVA_HOME"] = "/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/"
#jvm.start()
javabridge.start_vm()
print("Java Version:", javabridge.get_vm().get_version())
javabridge.kill_vm()
I don't know how to fix the problem, please give me some suggestions about it, I'll appreciate it. tqvm.
All the best to you all!