Sourcetrail icon indicating copy to clipboard operation
Sourcetrail copied to clipboard

Sourcetrail was unable to locate Java on this machine

Open luke8050 opened this issue 5 years ago • 32 comments
trafficstars

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 屏幕快照 2020-04-01 下午6 40 56

luke8050 avatar Apr 01 '20 10:04 luke8050

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 avatar Apr 02 '20 07:04 egraether

@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)

coolcgp avatar Apr 03 '20 00:04 coolcgp

Can you please start Sourcetrail from the Terminal with /Applications/Sourcetrail.app/Contents/MacOS/Sourcetrail and try again?

egraether avatar Apr 03 '20 16:04 egraether

@egraether I was exactly used 64bit java, and it also doesn't work by starting Sourcetrail from the Terminal

luke8050 avatar Apr 04 '20 09:04 luke8050

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. image

athenakia avatar Apr 04 '20 19:04 athenakia

Sourcetrail 2019.4.102 seems to be able to locate Java, but index 0 file after add an android studio gradle project. (´-`)

athenakia avatar Apr 04 '20 20:04 athenakia

I have the same problem. SourceTrail Version : Sourcetrail_2020_1_117

suood avatar Apr 04 '20 20:04 suood

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.

coolcgp avatar Apr 06 '20 00:04 coolcgp

I have solved this problem with Sourcetrail_2019_4_102_macOS_64bit.dmg

luke8050 avatar Apr 07 '20 01:04 luke8050

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.

egraether avatar Apr 07 '20 07:04 egraether

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

LouisStAmour avatar Apr 09 '20 06:04 LouisStAmour

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

justlaputa avatar Apr 17 '20 10:04 justlaputa

I have the same problem. SourceTrail Version : Sourcetrail_2020_1_117_macOS_64bit.dmg

z199172177 avatar Apr 22 '20 02:04 z199172177

Facing same issue with latest version..Sourcetrail_2020_1_117_macOS_64bit

vikrantchoudhary avatar Apr 27 '20 15:04 vikrantchoudhary

image

image

% 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)

yakirChen avatar May 09 '20 10:05 yakirChen

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.

verrol avatar May 14 '20 21:05 verrol

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)

fractalists avatar May 15 '20 05:05 fractalists

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.

egraether avatar Jun 01 '20 20:06 egraether

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.

davidjayb avatar Aug 24 '20 15:08 davidjayb

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.

rileytg avatar Sep 01 '20 15:09 rileytg

Why is this issue marked as closed? It is October 2020, I use version 2020.2.43 - 64bit - and still have the same issue:

Bildschirmfoto 2020-10-17 um 18 53 15

Sourcetrail has full disk access permissions on my mac (Catalina 10.15.6) V 2019.4.61 still works like a charm!

mrkdev avatar Oct 17 '20 16:10 mrkdev

image

nanxing7 avatar Dec 14 '20 08:12 nanxing7

Hi @mlangkabel , is there any workaround for this issue #955? Thanks in advance!

damir-majer avatar Apr 16 '21 09:04 damir-majer

Same Problem

MacOS Big Sur 11.3.1 (20E241) SourceTrail 2021.1.30 JDK 1.8

lyrl avatar May 06 '21 08:05 lyrl

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

johnamata avatar May 18 '21 16:05 johnamata

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.

Screenshot 2021-07-05 at 20 18 18

Looks like a code signing issue perhaps?

ls-jad-elkik avatar Jul 05 '21 18:07 ls-jad-elkik

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"

DoneSpeak avatar Jul 11 '21 03:07 DoneSpeak

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.

myrddian avatar Jul 23 '21 00:07 myrddian

Have the same issue ! Sourcetrail_2021_1_30_macOS_64bit.dmg

venkyvb avatar Oct 20 '21 01:10 venkyvb

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 image

ccomma avatar Oct 26 '21 10:10 ccomma