eclipse-equinox / equinox

equinox
Eclipse Public License 2.0
28 stars 60 forks source link

[macOS] Regression on Eclipse 4.31 launcher using relative `../bin/java` of a JDK with macOS layout #631

Open mdaloia opened 1 month ago

mdaloia commented 1 month ago

It seems that this change https://github.com/eclipse-equinox/equinox/commit/19582c5fc50a7946b8e642d26740daae8ba32197 introduced with PR https://github.com/eclipse-equinox/equinox/pull/481 on the native macOS launcher of Eclipse 4.31 breaks a previously working scenario (until 4.30) where the JVM used to launch Eclipse has a macOS layout (as it has Temurin) and you reference it under -vm in eclipse.ini with a relative path to bin/java

Error:

The JVM shared library "/Users/mdaloia/Downloads/launcher-bug/Eclipse.app/Contents/MacOS//../../../jdk-17.0.11+9-jre/Contents/Home/bin/../lib/server/libjvm.dylib"
does not contain the JNI_CreateJavaVM symbol.

image

Steps to reproduce

  1. Download Eclipse 4.31

  2. Open it once (to check that it work with the embedded JustJ JRE and so the macOS does the Notarization Gatekeeper check, otherwise if you modify it directly it will say that it is damaged).

  3. Download Adoptium Temurin JRE 17 for macOS (https://adoptium.net/temurin/releases/ )

  4. Extract the JRE at the same level of the Eclipse.app image

  5. Modify the -vm arg of Eclipse.app/Contents/Eclipse/eclipse.ini to:

    -vm
    ../../../jdk-17.0.11+9-jre/Contents/Home/bin/java
  6. Execute Eclipse.app

Workaround

Use:

 -vm
 ../../../jdk-17.0.11+9-jre/Contents/Home/lib/libjli.dylib
mdaloia commented 1 month ago

By the way, if you use the absolute path pointing to the same bin/java executable it works ok.

HannesWell commented 1 month ago

By the way, if you use the absolute path pointing to the same bin/java executable it works ok.

Do you think you can provide a PR with a proposed solution? But since I cannot help at all with Mac, maybe @sravanlakkimsetti or @Phillipus can help?

mdaloia commented 1 month ago

I'm sorry, but I don't know about ObjectiveC coding nor I have the proper environment.... maybe the original author could help on this...

@subyssurendran666 could you take a look at it?

Thanks in advance

subyssurendran666 commented 1 month ago

@mdaloia Sure, I'll check this issue and get back to you.

mdaloia commented 2 weeks ago

@subyssurendran666 Did you have time to look at it?