Sourcetrail
Sourcetrail copied to clipboard
Sourcetrail was unable to locate Java on this machine
hi, After creating the new project this message pops up
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/jdk1.8.0_181.jdk/Contents/Home/jre/lib/jli/libjli.dylib"
and my setting is

I use pretty much the exact same Java Path:
/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/jre/lib/jli/libjli.dylib
Are you sure this is 64bit Java?
@egraether I have the same problem. Sourcetrail_2020_1_117_macOS_64bit.dmg
I am sure 64bit java is installed on my macos.
echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home
java -version java version "1.8.0_211" Java(TM) SE Runtime Environment (build 1.8.0_211-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
Can you please start Sourcetrail from the Terminal with /Applications/Sourcetrail.app/Contents/MacOS/Sourcetrail and try again?
@egraether I was exactly used 64bit java, and it also doesn't work by starting Sourcetrail from the Terminal
Exactly the same error here!
no matter use libjli.dylib or libjvm.dylib
latest release Sourcetrail on macOS Catalina 10.15.3(19D76)
when fill path of libjli.dylib
03:52:30 | INFO: send MessageStatus Project could not load any symbols because the index database is empty. Please re-index the project.
03:52:30 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Project could not load any symbols because the index database is empty. Please re-index the project.
03:52:30 | INFO: send MessageRefresh
03:52:30 | utilityJava.cpp:78 prepareJavaEnvironmentAndDisplayOccurringErrors() | ERROR: Could not load library "/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/jli/libjli.dylib"
03:52:30 | INFO: send MessageStatus Could not load library "/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/jli/libjli.dylib" - error
03:52:30 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Could not load library "/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/jli/libjli.dylib"
03:52:30 | 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/jdk1.8.0_211.jdk/Contents/Home/jre/lib/jli/libjli.dylib" - error
03:52:30 | 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/jdk1.8.0_211.jdk/Contents/Home/jre/lib/jli/libjli.dylib"
03:52:39 | INFO: send MessageWindowClosed
03:52:39 | SharedMemoryGarbageCollector.cpp:77 stop() | INFO: stop shared memory garbage collection
03:52:39 | SharedMemoryGarbageCollector.cpp:132 stop() | INFO: delete garbage collector memory: grbg_cllctr_64
when fill path of libjvm.dylib
03:53:56 | INFO: send MessageStatus Project could not load any symbols because the index database is empty. Please re-index the project.
03:53:56 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Project could not load any symbols because the index database is empty. Please re-index the project.
03:53:56 | INFO: send MessageRefresh
03:53:56 | utilityJava.cpp:78 prepareJavaEnvironmentAndDisplayOccurringErrors() | ERROR: Could not load library "/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/server/libjvm.dylib"
03:53:56 | INFO: send MessageStatus Could not load library "/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/server/libjvm.dylib" - error
03:53:56 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Could not load library "/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/server/libjvm.dylib"
03:53:56 | 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/jdk1.8.0_211.jdk/Contents/Home/jre/lib/server/libjvm.dylib" - error
03:53:56 | 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/jdk1.8.0_211.jdk/Contents/Home/jre/lib/server/libjvm.dylib"
By the way, why the "auto detection" disappear on my Mac.

Sourcetrail 2019.4.102 seems to be able to locate Java, but index 0 file after add an android studio gradle project. (´-`)
I have the same problem. SourceTrail Version : Sourcetrail_2020_1_117
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/jdk1.8.0_211.jdk/Contents/Home/jre/lib/jli/libjli.dylib
@egraether
Can you please start Sourcetrail from the Terminal with /Applications/Sourcetrail.app/Contents/MacOS/Sourcetrail and try again?
I have tried the solution you proposed but failed.
I have solved this problem with Sourcetrail_2019_4_102_macOS_64bit.dmg
Thanks for the update! But I'm afraid that's not a solution for the current version.
Also, that's very strange. As far as I know, nothing Java related has changed since the last release, except some Java dependencies probably.
Might be related to https://bugs.openjdk.java.net/browse/JDK-8213362 fixed 17 months ago in https://github.com/openjdk/jdk/commit/7c6cb8cd7ededc3527513efeac6e54e20e5c6b76#diff-12cd0050ddf0e27634e419c88b0dc611
Alternatively, the code we have is at https://github.com/CoatiSoftware/Sourcetrail/blob/master/src/lib_gui/utility/path_detector/java_runtime/JavaPathDetectorMac.cpp#L22-L22 which does the right thing in calling java_home but it specifically looks inside a /lib/jli folder which as mentioned earlier is now /lib/libjli.dylib, so we probably need another fallback added.
The only possibly relevant change I can see would be https://github.com/CoatiSoftware/Sourcetrail/commit/ad464fc1b14e92a84b000f81580a6e8e8e081168
same problem, launching from cli:
~ ❯❯❯ ll -h /Library/Java/JavaVirtualMachines/jdk1.8.0_212.jdk/Contents/Home/jre/lib/jli/libjli.dylib
-rwxr-xr-x 1 root wheel 60K Apr 2 2019 /Library/Java/JavaVirtualMachines/jdk1.8.0_212.jdk/Contents/Home/jre/lib/jli/libjli.dylib
~ ❯❯❯ /Applications/Sourcetrail.app/Contents/MacOS/Sourcetrail
...
19:50:44 | utilityJava.cpp:78 prepareJavaEnvironmentAndDisplayOccurringErrors() | ERROR: Could not load library "/Library/Java/JavaVirtualMachines/jdk1.8.0_212.jdk/Contents/Home/jre/lib/jli/libjli.dylib"
19:50:44 | INFO: send MessageStatus Could not load library "/Library/Java/JavaVirtualMachines/jdk1.8.0_212.jdk/Contents/Home/jre/lib/jli/libjli.dylib" - error
19:50:44 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Could not load library "/Library/Java/JavaVirtualMachines/jdk1.8.0_212.jdk/Contents/Home/jre/lib/jli/libjli.dylib"
19:50:44 | 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/jdk1.8.0_212.jdk/Contents/Home/jre/lib/jli/libjli.dylib" - error
19:50:44 | 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/jdk1.8.0_212.jdk/Contents/Home/jre/lib/jli/libjli.dylib"
19:50:51 | INFO: send MessageWindowClosed
19:50:51 | SharedMemoryGarbageCollector.cpp:77 stop() | INFO: stop shared memory garbage collection
19:50:51 | SharedMemoryGarbageCollector.cpp:132 stop() | INFO: delete garbage collector memory: grbg_cllctr_64
I have the same problem. SourceTrail Version : Sourcetrail_2020_1_117_macOS_64bit.dmg
Facing same issue with latest version..Sourcetrail_2020_1_117_macOS_64bit


% java -version
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
I am having this problem on the latest Sourcetrail on Catalina 10.15.4.
$ java -version java version "1.8.0_241" Java(TM) SE Runtime Environment (build 1.8.0_241-b07) Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)
I tried both the brew install and downloading the latest dmg file. Both have the same problem.
Same problem for me on MacOS Catalina 10.15.4
$ java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
I inspected this issue on macOS Mojave and Catalina, with different JDK versions.
As mentioned by @LouisStAmour it seems that the location of libjli.dylib is not the same for different JDK versions and has changed in newer versions. The docs and auto detection are out-of-date.
libjli.dylib is now also available at /Library/Java/JavaVirtualMachines/<jdk_version>/Contents/MacOS/libjli.dylib. These two paths worked fine for me
/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/MacOS/libjli.dylib
/Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/MacOS/libjli.dylib
I will update the docs and take a look at the auto detection.
This is still an issue. I downloaded the latest Sourcetrail -- 2020.2.43, upgrading from 2019.4.61 -- and faced the same error as described here. Downgrading back to 2019.4.61 fixed the issue.
downgrading to was the only solution that worked for me (2019.4.61)
i tried using corretto 8 and 11, openjdk 1.8 and oracle's 1.8. i tried from terminal. i tried giving full disk permissions in System Prefs.
Why is this issue marked as closed? It is October 2020, I use version 2020.2.43 - 64bit - and still have the same issue:
Sourcetrail has full disk access permissions on my mac (Catalina 10.15.6) V 2019.4.61 still works like a charm!
Hi @mlangkabel , is there any workaround for this issue #955? Thanks in advance!
Same Problem
MacOS Big Sur 11.3.1 (20E241) SourceTrail 2021.1.30 JDK 1.8
getting the same problem at SourceTrail 2021.1.30 so I downgraded to 2019.4.61, but I am still getting an error.
The fix was upgrading java and changing my java preferences from
/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/MacOS/libjli.dylib
to
/Library/Java/JavaVirtualMachines/jdk-14.0.2.jdk/Contents/MacOS/libjli.dylib
I got this in the system logs if this helps:
default 20:12:18.266448+0200 ContextStoreAgent mach error: 1100
default 20:12:18.266671+0200 ContextStoreAgent ocspdGlobals: error contacting server
default 20:12:18.266760+0200 ContextStoreAgent ocspdTrustSettingsRead: OCSPD server error
default 20:12:18.267962+0200 ContextStoreAgent mach error: 1100
default 20:12:18.268033+0200 ContextStoreAgent ocspdGlobals: error contacting server
default 20:12:18.268094+0200 ContextStoreAgent ocspdTrustSettingsRead: OCSPD server error
default 20:12:18.268527+0200 ContextStoreAgent mach error: 1100
default 20:12:18.268608+0200 ContextStoreAgent ocspdGlobals: error contacting server
default 20:12:18.269048+0200 ContextStoreAgent ocspdTrustSettingsRead: OCSPD server error
error 20:12:18.266074+0200 kernel Sandbox: ContextStoreAgen(717) deny(1) mach-lookup com.apple.ocspd
default 20:12:18.271213+0200 ContextStoreAgent mach error: 1100
default 20:12:18.271323+0200 ContextStoreAgent ocspdGlobals: error contacting server
default 20:12:18.271480+0200 ContextStoreAgent ocspdTrustSettingsRead: OCSPD server error
default 20:12:18.272016+0200 ContextStoreAgent mach error: 1100
default 20:12:18.272088+0200 ContextStoreAgent ocspdGlobals: error contacting server
default 20:12:18.272265+0200 ContextStoreAgent ocspdTrustSettingsRead: OCSPD server error
default 20:12:18.272644+0200 ContextStoreAgent mach error: 1100
default 20:12:18.272742+0200 ContextStoreAgent ocspdGlobals: error contacting server
default 20:12:18.272932+0200 ContextStoreAgent ocspdTrustSettingsRead: OCSPD server error
default 20:12:18.295433+0200 dasd Trigger: <private> is now [<private>]
error 20:12:19.051944+0200 kernel Library Validation failed: Rejecting '/Library/Java/JavaVirtualMachines/openjdk-13.0.1.jdk/Contents/Home/lib/libjli.dylib' (Team ID: none, platform: no) for process 'Sourcetrail(82928)' (Team ID: 5NA3L2R4V8, platform: no), reason: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
App logs:
20:10:57 | LogManager.cpp:40 setLoggingEnabled() | INFO: Enabled logging for Sourcetrail 64 bit, version 2021.1.30
...
20:12:19 | utilityJava.cpp:79 prepareJavaEnvironmentAndDisplayOccurringErrors() | ERROR: Could not load library "/Library/Java/JavaVirtualMachines/openjdk-13.0.1.jdk/Contents/Home/lib/libjli.dylib"
20:12:19 | INFO: send MessageStatus Could not load library "/Library/Java/JavaVirtualMachines/openjdk-13.0.1.jdk/Contents/Home/lib/libjli.dylib" - error
20:12:19 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Could not load library "/Library/Java/JavaVirtualMachines/openjdk-13.0.1.jdk/Contents/Home/lib/libjli.dylib"
20:12:19 | INFO: send MessageStatus Sourcetrail was unable to initialize Java environment on this machine. Please make sure to provide the correct Java Path in the preferences. Error: Could not load library "/Library/Java/JavaVirtualMachines/openjdk-13.0.1.jdk/Contents/Home/lib/libjli.dylib" - error
20:12:19 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Sourcetrail was unable to initialize Java environment on this machine. Please make sure to provide the correct Java Path in the preferences. Error: Could not load library "/Library/Java/JavaVirtualMachines/openjdk-13.0.1.jdk/Contents/Home/lib/libjli.dylib"
20:12:22 | INFO: send MessageWindowFocus
Tried it with OpenJDK 8 and Corretto 11, same thing.

Looks like a code signing issue perhaps?
Same problem
Sourcetrail_2021_1_30_macOS_64bit.dmg macOS Big Sur 11.4
ERROR Could not load library "/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/MacOS/libjli.dylib" ERROR Sourcetrail was unable to initialize Java environment on this machine. Please make sure to provide the correct Java Path in the preferences. Error: Could not load library "/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/MacOS/libjli.dylib"
I am having the same issue - back in 2020 when this bug appeared the first time I had to revert to an old 2019 release, I hoped that in 2020 it would be fixed but this bug was closed with no resolution. Now in 2021 I still cant use this, I have tried pointing to the system version of Java, installed AdoptOpenJDK - I have multiple JVM's in my system - not including homebrew installs which I dont point SourceTrail to.
Have the same issue ! Sourcetrail_2021_1_30_macOS_64bit.dmg
HELP!
I used zulu-jdk8 and this problem also appeared on Sourcetrail_2021_1_30_macOS_64bit.dmg and Sourcetrail_2019_4_102_macOS_64bit.dmg.
macOS Monterey 12.0.1
