Opened 3 years ago

Closed 3 years ago

#63345 closed defect (fixed)

openjdk16-temurin @16.0.2_0: libjli.dylib code signature invalid after upgrading to new openjdk16-temerin

Reported by: JD-Veiga Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc: nils@…
Port: openjdk16-temurin

Description (last modified by JD-Veiga)

Hi,

I have been experienced difficulties with Java after upgrading openjdk16 to version 16.0.2 (which adds port openjdk16-temurin).

When I try to run Eclipse from terminal, I got the following message:

Error loading /Library/Java/JavaVirtualMachines/openjdk16-temurin/Contents/MacOS/libjli.dylib:  dlopen(/Library/Java/JavaVirtualMachines/openjdk16-temurin/Contents/MacOS/libjli.dylib, 265): no suitable image found.  Did find:
	/Library/Java/JavaVirtualMachines/openjdk16-temurin/Contents/MacOS/libjli.dylib: code signature invalid for '/Library/Java/JavaVirtualMachines/openjdk16-temurin/Contents/MacOS/libjli.dylib'

Conversely, when I ran Eclipse from its icon (app), I got a different message:

The JVM shared library "/Library/Java/JavaVirtualMachines/openjdk16-temurin/Contents/Home/bin/../lib/server/libjvm.dylib"
does not contain the JNI_CreateJavaVM symbol.

However, I think that the ultimate cause could be that libjli.dylib is not properly signed.

Whatever the cause, both libjli.dylib and libjvm.dylib exist in their corresponding directories.

I am running:

  • macos Mojave 10.14.6
  • MacPorts 2.7.1

Thanks a lot.

Change History (14)

comment:1 Changed 3 years ago by breun (Nils Breunese)

MacPorts doesn't build or sign these files, MacPorts just installs the Eclipse Temurin binary distribution and on my machine (macOS Big Sur 11.5.1) both libjli.dylib and libjvm.dylib seem OK:

❯ codesign -v -v /Library/Java/JavaVirtualMachines/openjdk16-temurin/Contents/MacOS/libjli.dylib          
/Library/Java/JavaVirtualMachines/openjdk16-temurin/Contents/MacOS/libjli.dylib: valid on disk
/Library/Java/JavaVirtualMachines/openjdk16-temurin/Contents/MacOS/libjli.dylib: satisfies its Designated Requirement
❯ codesign -v -v /Library/Java/JavaVirtualMachines/openjdk16-temurin/Contents/Home/lib/server/libjvm.dylib      
/Library/Java/JavaVirtualMachines/openjdk16-temurin/Contents/Home/lib/server/libjvm.dylib: valid on disk
/Library/Java/JavaVirtualMachines/openjdk16-temurin/Contents/Home/lib/server/libjvm.dylib: satisfies its Designated Requirement

Can you check the output of these commands on your machine?

By running Eclipse, do you mean Eclipse IDE (https://www.eclipse.org/eclipseide/)? I don't use this myself, but according to https://www.eclipse.org/downloads/packages/installer the latest installer includes a JRE to run the IDE.

There is also the openjdk16-zulu port which provides the Azul Zulu build of OpenJDK 16. Maybe you could try to see if that one works for you?

Last edited 3 years ago by breun (Nils Breunese) (previous) (diff)

comment:2 Changed 3 years ago by JD-Veiga

Description: modified (diff)

comment:3 Changed 3 years ago by breun (Nils Breunese)

According to https://wiki.eclipse.org/Eclipse/Installation running Eclipse IDE requires Java 11 or newer. Does Eclipse IDE work ok if you install openjdk11-temurin and set JAVA_HOME to /Library/Java/JavaVirtualMachines/openjdk11-temurin/Contents/Home? (Or installing openjdk11-zulu and setting JAVA_HOME to /Library/Java/JavaVirtualMachines/openjdk11-zulu/Contents/Home?)

Java 16 will reach end of life when Java 17 is released next month anyway. (Java 11 is a Long Term Support release that will be supported for another while.)

The Eclipse IDE documentation also mentions that their installer includes a JRE, which suggests you don't need to install a separate JDK to run Eclipse IDE. You still need to install a JDK and configure it in Eclipse IDE if you want to compile Java applications, but you don't need to use that JDK to run Eclipse itself.

Last edited 3 years ago by breun (Nils Breunese) (previous) (diff)

comment:4 Changed 3 years ago by JD-Veiga

Ooops, sorry! Indeed the Eclipse IDE GUI error is:

The JVM shared library "/Library/Java/JavaVirtualMachines/openjdk16-temurin/Contents/Home/bin/../lib/server/libjvm.dylib"
does not contain the JNI_CreateJavaVM symbol.

I have tried the codesign -v -v commands and got the same result as yours.

Only some packages of Eclipse IDE include a JRE. I am almost certain that Eclipse IDE for PHP Developers (my installation) did not include any JRE when I installed it -- I have being upgrading Eclipse IDE and Java separately on the same computer since (about) 2005.

I have set JAVA_HOME properly (as well as eclipse.ini file --which it is also required).

I will try your suggestions tomorrow and will provide further details as soon as I can. Thank you, Nils.

comment:5 Changed 3 years ago by JD-Veiga

After some experiments, I think that Eclipse IDE does not support openjdk16-temurin. I can run it with openjdk 16.0.1 though.

I have noticed that some other Java programs in my computer have also stopped to work after upgrading to the latest openjdk16 port.

However, most of them are outdated and, after being upgraded, they run smoothly again. These new versions embed their own copies of JRE in the app bundle (while previous releases rely on system's JRE -- macports openjdk in my case).

Additionally, I have found that most of these "embedded" JREs include their own copies of libjli.dylib or libjvm.dylib.

In short, I have concluded that this is an Eclipse IDE issue, nothing related to openjdk16 port.

Sorry for burden you with my problems. Thank very much for your help and suggestions.

Last edited 3 years ago by JD-Veiga (previous) (diff)

comment:6 Changed 3 years ago by breun (Nils Breunese)

To verify that MacPorts has nothing to do with this, you could download the Eclipse Temurin 16.0.2 release .tar.gz archive directly from https://adoptium.net/releases.html?variant=openjdk16&jvmVariant=hotspot yourself and see if you can reproduce the issue with running Eclipse IDE using that.

(Eclipse Temurin is the successor to AdoptOpenJDK, which was used previously for the openjdk* ports. You can read more about that transition on https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/)

comment:7 Changed 3 years ago by JD-Veiga

Clearly, an Eclipse IDE issue. I did not manage to run Eclipse IDE with Adoptium jdk-16.0.2+7 Temurin, as you suggested. Thank you.

comment:8 Changed 3 years ago by breun (Nils Breunese)

Ok, that is a bit surprising, but thanks for verifying!

comment:9 Changed 3 years ago by JD-Veiga

FYI

I have found a similar issue report in Adoptium codebase: https://github.com/adoptium/adoptium-support/issues/33, reported last Monday.

There is also in Eclipse IDE Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=575284, also reported on Monday.

comment:10 Changed 3 years ago by breun (Nils Breunese)

https://github.com/adoptium/adoptium-support/issues/33 was not reported last Monday, but in December 2019 and looks unrelated. Maybe there's a typo in that link?

comment:12 Changed 3 years ago by breun (Nils Breunese)

Ok thanks. I’ve subscribed to that issue and I’ll update the port when they fix the issue. I guess you can run Eclipse using another JVM provider for now, like openjdk11-zulu? Java 16 reaches end of life in a month anyway, when Java 17 comes out.

Last edited 3 years ago by breun (Nils Breunese) (previous) (diff)

comment:13 Changed 3 years ago by JD-Veiga

Hi,

JFYI. I have upgraded to openjdk17-temurin (and consequently uninstalled openjdk16 and openjdk16-temurin). Eclipse IDE (which has been upgraded a few days ago) now works fine with temurin.

Thank you for your help.

comment:14 Changed 3 years ago by reneeotten (Renee Otten)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.