Sourcetrail
Sourcetrail copied to clipboard
Sourcetrail was unable to locate Java on this machine. Please make sure to provide the correct Java Path in the preferences. Error: Could not load library "/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/MacOS/libjli.dylib"
I have multiple JDKs installed, I get the same error for all of them -
22:54:26 | 0x70000f16a000 | INFO: send MessageWindowFocus
22:54:26 | 0x70000f16a000 | INFO: send MessagePingReceived
22:54:26 | 0x11a6615c0 | IDECommunicationController.cpp:167 handlePing() | INFO: IntelliJ IDEA instance detected via plugin port
22:54:26 | 0x70000f16a000 | INFO: send MessagePingReceived
22:54:27 | 0x70000f16a000 | INFO: send MessageIndexingShowDialog
22:54:27 | 0x70000f16a000 | INFO: send MessageRefresh
22:54:28 | 0x70000f064000 | utilityJava.cpp:78 prepareJavaEnvironmentAndDisplayOccurringErrors() | ERROR: Could not load library "/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/MacOS/libjli.dylib"
22:54:28 | 0x70000f16a000 | INFO: send MessageStatus Could not load library "/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/MacOS/libjli.dylib" - error
22:54:28 | 0x70000f16a000 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Could not load library "/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/MacOS/libjli.dylib"
22:54:28 | 0x70000f16a000 | INFO: send MessageStatus Sourcetrail was unable to locate Java on this machine. Please make sure to provide the correct Java Path in the preferences. Error: Could not load library "/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/MacOS/libjli.dylib" - error
22:54:28 | 0x70000f16a000 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Sourcetrail was unable to locate Java on this machine. Please make sure to provide the correct Java Path in the preferences. Error: Could not load library "/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/MacOS/libjli.dylib"
22:54:29 | 0x70000f16a000 | INFO: send MessageWindowFocus
Occurs for me as well on Catalina 10.15.5 SourceTrail version 2020.2.43 - 64 bit Database Version 25
I dug a little into the what the code was doing and based on the error message, it seems to occur when it first tries to load the JNI_CreateJavaVM()
function using a dlopen()
on libjli.dylib
https://github.com/CoatiSoftware/Sourcetrail/blob/2020.2.43/src/lib/utility/utilityLibrary.h#L70-L75
I don't have my machine setup to actually debug but I'd be very interested to see what dlerror()
returns within that if(handle == nullptr) {}
block
Still problem with Sourcetrail version 2020.4.35 I am running macOS BigSur version 11.2 (build 20D64) and latest OpenJDK version 15:
$ java -version
openjdk version "15.0.2" 2021-01-19
OpenJDK Runtime Environment (build 15.0.2+7-27)
OpenJDK 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
I guess SourceTrail should be built with this option to be true:
https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-library-validation
I have the same problem with Apple M1 silicon
I have the same problem with Apple Big Sur
I also have the same problem with Big Sur.
I have the same problem with Big Sur 11.4 ( Could not load library "/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/MacOS/libjli.dylib"