Sourcetrail icon indicating copy to clipboard operation
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"

Open ultranav opened this issue 4 years ago • 7 comments

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

image

image

ultranav avatar Jun 26 '20 17:06 ultranav

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

dgcofer avatar Jul 22 '20 15:07 dgcofer

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)

luolong avatar Feb 11 '21 10:02 luolong

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

Dieken avatar Feb 17 '21 05:02 Dieken

I have the same problem with Apple M1 silicon

ebauger avatar Jun 08 '21 22:06 ebauger

I have the same problem with Apple Big Sur

codegrady avatar Jun 25 '21 06:06 codegrady

I also have the same problem with Big Sur.

ajing avatar Jul 10 '21 19:07 ajing

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"

SimonHunag avatar Aug 12 '21 09:08 SimonHunag