Skip to content
This repository has been archived by the owner on Sep 22, 2024. It is now read-only.

Epoch IDE fails to launch on MacOS #10

Closed
Shrajan opened this issue May 16, 2022 · 16 comments
Closed

Epoch IDE fails to launch on MacOS #10

Shrajan opened this issue May 16, 2022 · 16 comments
Labels
help wanted Extra attention is needed

Comments

@Shrajan
Copy link

Shrajan commented May 16, 2022

I followed the instructions mentioned on the official page (https://www.lf-lang.org/docs/handbook/epoch-ide) to install Epoch IDE on a MacBook Pro M1. I get the following error when I try to launch the application with version 0.2.0 as well as the nightly build.

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

I followed the steps mentioend here https://stackoverflow.com/a/33477302/2919326, and modified the Info.plist file to set the correct Java path. Unfortunately, the problem still persists.

Please let me know how to solve this. Thank you very much.

@lhstrh
Copy link
Member

lhstrh commented May 17, 2022

I'm unfamiliar with this problem, but let's check the following:

Is your $JAVA_HOME environment variable set? (echo $JAVA_HOME)
Does $JAVA_HOME _exactly match your Info.plist?
What is the output of /usr/libexec/java_home -V?

@Shrajan
Copy link
Author

Shrajan commented May 17, 2022

@lhstrh Thank you for the quick reply.

$JAVA_HOME:

echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk-17.0.3.1.jdk/Contents/Home

Info.plist Java Version matches $JAVA_HOME: jdk-17.0.3.1.jdk

<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk-17.0.3.1.jdk/Contents/Home/bin/java</string>

Output of /usr/libexec/java_home -V:

Matching Java Virtual Machines (2):
    18.0.1 (arm64) "Azul Systems, Inc." - "Zulu 18.30.11" /Library/Java/JavaVirtualMachines/zulu-18.jdk/Contents/Home
    17.0.3.1 (arm64) "Oracle Corporation" - "Java SE 17.0.3.1" /Library/Java/JavaVirtualMachines/jdk-17.0.3.1.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/zulu-18.jdk/Contents/Home

@lhstrh
Copy link
Member

lhstrh commented May 17, 2022

I don't see any red flags here, but there's also no way for me to replicate because I don't have a MacBook. Tagging @Soroosh129 who is also running on Apple silicon.

@Soroosh129
Copy link

Soroosh129 commented May 17, 2022

I encounter the same issue with the latest nightly.

The path reported in the error message for me is pointing to the right location as far as I can tell:
image

soroush@Soroushs-MacBook-Air ~ % ls -l /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/bin/../lib/server/libjvm.dylib
-rw-r--r--  1 root  wheel  15639072 Aug  5  2021 /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/bin/../lib/server/libjvm.dylib

According to this issue, not properly notarizing Epoch could be the culprit.

@cmnrd cmnrd added the bug Something isn't working label Jul 12, 2022
@lhstrh
Copy link
Member

lhstrh commented Jul 22, 2022

Just bumping this thread to let everyone know this is on our radar and we're working on it.

Note to self: this is the process we need to automate in CI: https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution#3087722

@lhstrh
Copy link
Member

lhstrh commented Sep 17, 2022

Error output from attempted code signing below. TL;DR: 6 out of the 14 errors here are due to PyDev, and the rest are due to Kotlin (org.jetbrains.kotlin.bundled-compiler to be specific).

  "issues": [
    {
      "severity": "error",
      "code": null,
      "path": "epoch_ide_0.3.0-macosx.cocoa.x86_64.zip/epoch.app/Contents/Eclipse/plugins/org.jetbrains.kotlin.bundled-compiler_0.8.21.v20200816-2059.jar/lib/kotlin-compiler.jar/META-INF/native/osx/libjansi.jnilib",
      "message": "The binary is not signed.",
      "docUrl": null,
      "architecture": "i386"
    },
    {
      "severity": "error",
      "code": null,
      "path": "epoch_ide_0.3.0-macosx.cocoa.x86_64.zip/epoch.app/Contents/Eclipse/plugins/org.jetbrains.kotlin.bundled-compiler_0.8.21.v20200816-2059.jar/lib/kotlin-compiler.jar/META-INF/native/osx/libjansi.jnilib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": null,
      "architecture": "i386"
    },
    {
      "severity": "error",
      "code": null,
      "path": "epoch_ide_0.3.0-macosx.cocoa.x86_64.zip/epoch.app/Contents/Eclipse/plugins/org.jetbrains.kotlin.bundled-compiler_0.8.21.v20200816-2059.jar/lib/kotlin-compiler.jar/META-INF/native/osx/libjansi.jnilib",
      "message": "The binary is not signed.",
      "docUrl": null,
      "architecture": "x86_64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "epoch_ide_0.3.0-macosx.cocoa.x86_64.zip/epoch.app/Contents/Eclipse/plugins/org.jetbrains.kotlin.bundled-compiler_0.8.21.v20200816-2059.jar/lib/kotlin-compiler.jar/META-INF/native/osx/libjansi.jnilib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": null,
      "architecture": "x86_64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "epoch_ide_0.3.0-macosx.cocoa.x86_64.zip/epoch.app/Contents/Eclipse/plugins/org.jetbrains.kotlin.bundled-compiler_0.8.21.v20200816-2059.jar/lib/kotlin-compiler.jar/com/sun/jna/darwin/libjnidispatch.jnilib",
      "message": "The binary is not signed.",
      "docUrl": null,
      "architecture": "i386"
    },
    {
      "severity": "error",
      "code": null,
      "path": "epoch_ide_0.3.0-macosx.cocoa.x86_64.zip/epoch.app/Contents/Eclipse/plugins/org.jetbrains.kotlin.bundled-compiler_0.8.21.v20200816-2059.jar/lib/kotlin-compiler.jar/com/sun/jna/darwin/libjnidispatch.jnilib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": null,
      "architecture": "i386"
    },
    {
      "severity": "error",
      "code": null,
      "path": "epoch_ide_0.3.0-macosx.cocoa.x86_64.zip/epoch.app/Contents/Eclipse/plugins/org.jetbrains.kotlin.bundled-compiler_0.8.21.v20200816-2059.jar/lib/kotlin-compiler.jar/com/sun/jna/darwin/libjnidispatch.jnilib",
      "message": "The binary is not signed.",
      "docUrl": null,
      "architecture": "x86_64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "epoch_ide_0.3.0-macosx.cocoa.x86_64.zip/epoch.app/Contents/Eclipse/plugins/org.jetbrains.kotlin.bundled-compiler_0.8.21.v20200816-2059.jar/lib/kotlin-compiler.jar/com/sun/jna/darwin/libjnidispatch.jnilib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": null,
      "architecture": "x86_64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "epoch_ide_0.3.0-macosx.cocoa.x86_64.zip/epoch.app/Contents/Eclipse/plugins/org.python.pydev.jython_9.0.1.202108191530/jython.jar/jni/Darwin/libjffi-1.2.jnilib",
      "message": "The binary is not signed.",
      "docUrl": null,
      "architecture": "i386"
    },
    {
      "severity": "error",
      "code": null,
      "path": "epoch_ide_0.3.0-macosx.cocoa.x86_64.zip/epoch.app/Contents/Eclipse/plugins/org.python.pydev.jython_9.0.1.202108191530/jython.jar/jni/Darwin/libjffi-1.2.jnilib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": null,
      "architecture": "i386"
    },
    {
      "severity": "error",
      "code": null,
      "path": "epoch_ide_0.3.0-macosx.cocoa.x86_64.zip/epoch.app/Contents/Eclipse/plugins/org.python.pydev.jython_9.0.1.202108191530/jython.jar/jni/Darwin/libjffi-1.2.jnilib",
      "message": "The binary is not signed.",
      "docUrl": null,
      "architecture": "x86_64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "epoch_ide_0.3.0-macosx.cocoa.x86_64.zip/epoch.app/Contents/Eclipse/plugins/org.python.pydev.jython_9.0.1.202108191530/jython.jar/jni/Darwin/libjffi-1.2.jnilib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": null,
      "architecture": "x86_64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "epoch_ide_0.3.0-macosx.cocoa.x86_64.zip/epoch.app/Contents/Eclipse/plugins/org.python.pydev.core_9.0.1.202108191530/pysrc/pydevd_attach_to_process/attach_x86_64.dylib",
      "message": "The binary is not signed.",
      "docUrl": null,
      "architecture": "x86_64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "epoch_ide_0.3.0-macosx.cocoa.x86_64.zip/epoch.app/Contents/Eclipse/plugins/org.python.pydev.core_9.0.1.202108191530/pysrc/pydevd_attach_to_process/attach_x86_64.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": null,
      "architecture": "x86_64"
    }
  ]

@lhstrh
Copy link
Member

lhstrh commented Sep 17, 2022

In the rm-unsigned-deps branch (see lf-lang/lingua-franca#1371) the problematic dependencies have been removed. I think it would be worth to make another attempt of notarization using the code in that branch (if we can make it to compile).

@lhstrh
Copy link
Member

lhstrh commented Sep 21, 2022

Unfortunately, we haven't been able to address this because the Epoch build must include a Kotlin plugin that has not been maintained and contains unsigned binaries, which prevents us for notarizing the app.

If Epoch were to instead use our language server, then there would be no Kotlin sources to compile, but transforming Epoch into a standalone Eclipse plugin enabled through LSP is quite involved and not something we can currently take on. We might be able to do this sometime in the future, so I'm moving this issue to the next milestone.

@cmnrd
Copy link
Contributor

cmnrd commented Sep 23, 2022

It turns out that the underlying issue (a broken/outdated Eclipse plugin) not only surfaces in MacOS but also affects other platforms (See lf-lang/lingua-franca#1311).

@soerendomroes
Copy link
Collaborator

soerendomroes commented Nov 4, 2022

I followed the instructions mentioned on the official page (https://www.lf-lang.org/docs/handbook/epoch-ide) to install Epoch IDE on a MacBook Pro M1. I get the following error when I try to launch the application with version 0.2.0 as well as the nightly build.

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

I followed the steps mentioend here https://stackoverflow.com/a/33477302/2919326, and modified the Info.plist file to set the correct Java path. Unfortunately, the problem still persists.

Please let me know how to solve this. Thank you very much.

Hi, we found a solution for this.
By installing an a x86_64 Java we could get it running again by doing arch -x86_64 brew install openjdk@17 (https://stackoverflow.com/questions/70220737/apache-directory-studio-on-apple-m1-silicon).
Apparently, we can still use x86_64 on an arm64 system if we really want it. For me that required a user local brew installation to allow me to install the x86_64 Java.

@lhstrh
Copy link
Member

lhstrh commented Nov 7, 2022

@soerendomroes does this suggest that the issue in fact is not a code signing issue but a JVM compatibility issue?

@soerendomroes
Copy link
Collaborator

@lhstrh Yes, if you download the ide and try to execute it via the terminal, it should give you an error message that you are trying to use a x86 program on a arm processor.

@lhstrh
Copy link
Member

lhstrh commented Nov 8, 2022

🤦 OK, so the fix to this issue is to update the installation instructions for M1 Macs?

@lhstrh
Copy link
Member

lhstrh commented Nov 8, 2022

Also, why does brew take architecture parameters in such a strange way...?

@lhstrh
Copy link
Member

lhstrh commented Nov 8, 2022

I'm thinking it would make more sense to publish Lingua Franca on Homebrew: https://docs.brew.sh/Adding-Software-to-Homebrew

My guess is that we should be able to specify a dependency on the x86_64 version of Java in the recipe. Any Mac users interested in volunteering to do this?

@lhstrh lhstrh added help wanted Extra attention is needed and removed bug Something isn't working labels Nov 8, 2022
@schoeberl
Copy link

I guess that would be a cool move.

@lhstrh lhstrh transferred this issue from lf-lang/lingua-franca Mar 4, 2023
@lhstrh lhstrh closed this as not planned Won't fix, can't repro, duplicate, stale Sep 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants