Sourcetrail icon indicating copy to clipboard operation
Sourcetrail copied to clipboard

Sourcetrail was unable to locate Java on this machine (macOS Catalina 10.15.5 (19F101))

Open mpirker-piengineering opened this issue 4 years ago • 11 comments

Hello,

I am getting the following error when trying to load a Java Project: 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.0.1.jdk/Contents/MacOS/libjli.dylib"

Java is properly installed: $ /usr/libexec/java_home -V Matching Java Virtual Machines (4): 14.0.1, x86_64: "OpenJDK 14.0.1" /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home 1.8.0_92, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home 1.7.0_80, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home 1.7.0_71, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home

The file is also there: $ ls -la /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/MacOS/libjli.dylib -rwxr-xr-x@ 1 root wheel 80704 5 Mär 12:06 /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/MacOS/libjli.dylib

I am using the very latest sourcetrail version 2020.2.43.

What can I do to resolve this issue?

Thank you.

mpirker-piengineering avatar Jul 01 '20 07:07 mpirker-piengineering

I don't know, it should work this way.

egraether avatar Jul 01 '20 07:07 egraether

Is not this issue a duplicate of #1045? I am here because I have the same issue on OSX but with adoptopenjdk-8.jdk.

dexpota avatar Jul 08 '20 19:07 dexpota

Me as well. Latest MacOS Catalina 10-15-6, even unable to set the Java preference, (when I do I still get the same error)

Weirdly, the included Java Source project (javaparser.srctrlprj) Works Just Fine. (But perhaps it has already been processed into some kind of AST or whatever by some other JRE?)

xt0fer avatar Aug 21 '20 15:08 xt0fer

I see it again too, is it solved ???

future1314 avatar Aug 27 '20 04:08 future1314

Just ran into this same error.

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/openjdk-14.jdk/Contents/MacOS/libjli.dylib"

version: 2020.2.43 osx: 10.15.5

The library exists.

❯ ls /Library/Java/JavaVirtualMachines/openjdk-14.jdk/Contents/MacOS/libjli.dylib
/Library/Java/JavaVirtualMachines/openjdk-14.jdk/Contents/MacOS/libjli.dylib

❯ file /Library/Java/JavaVirtualMachines/openjdk-14.jdk/Contents/MacOS/libjli.dylib
/Library/Java/JavaVirtualMachines/openjdk-14.jdk/Contents/MacOS/libjli.dylib: Mach-O 64-bit dynamically linked shared library x86_64

vsimon avatar Sep 04 '20 02:09 vsimon

When I disabled SIP (do at you own risk!), the problem went away. I wonder if it is similar to JDK-8139288.

Jabbslad avatar Sep 28 '20 22:09 Jabbslad

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 issue with:

  • SourceTrail 2020.4.35
  • MacOS Bg Sur 11.2.1
  • /Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home/lib/jli/libjli.dylib

I have also tried with all 2020.x.x versions and I get the same problem (all other variables being the same). As others have reported, downgrading to 2019.4.102 was worked for me.

serodriguez68 avatar Feb 28 '21 06:02 serodriguez68

Same result with:

  • SourceTrail 2021.1.30
  • macOS Big Sur 11.3.1
  • /Library/Java/JavaVirtualMachines/sapmachine-11.jdk/Contents/MacOS/libjli.dylib

mpern avatar May 25 '21 09:05 mpern

Still an issue with macOS Big Sur 11.4 and SourceTrail 2021.1.30

hkjels avatar Jul 08 '21 12:07 hkjels

Version 2021.4.19 The problem still exists

lyrl avatar Dec 09 '21 08:12 lyrl