protege icon indicating copy to clipboard operation
protege copied to clipboard

Native execution on M1 Mac / JDK17

Open m0squito opened this issue 3 years ago • 2 comments

I am able to run Protégé on an M1 MBP via Rosetta 2, but I would prefer to run it natively. From reading some of the issues, I am aware that upgrading the release to anywhere beyond JDK8 requires a major effort (especially with the plugins) that the maintainers cannot currently afford. However, is it possible to properly build a native version of a vanilla Protégé on an ARM-based Mac with JDK17 today? I built the java11 branch (although had to skip tests to complete it), but I am getting this error when executing the run.sh script under protege-desktop:

java.lang.IllegalAccessError: class org.coode.mdock.NodeSerialiser (in unnamed module @0x666762f0) cannot access class com.sun.org.apache.xml.internal.serialize.OutputFormat (in module java.xml) because module java.xml does not export com.sun.org.apache.xml.internal.serialize to unnamed module @0x666762f0

Could this be alleviated by opening some of the modules via --add-opens or is this effort entirely futile at this point?

m0squito avatar Jan 24 '22 17:01 m0squito

If you just want to run Protégé on ARM, I am running Protégé natively on a MBP M1 Max using the Protégé "Platform independent version" in combination with the Azul Zulu OpenJDK version 8 (ARM 64-bit). Works just fine!

SaschaLosko avatar Jan 31 '22 04:01 SaschaLosko

I was not aware there was a native build of JDK8 for aarch64!

I confirm that I am able to run it from the command line (after setting the JAVA_HOME to Zulu) via ruh.sh.

Thank you

m0squito avatar Jan 31 '22 18:01 m0squito

Get tired of running protege via Emulation, here is Protege for M1

Download Azul JDK 1.8 for Arm and install it in your OS Get this modified Protege.app - https://drive.google.com/file/d/1jgBS7lhvOOVOJHxHIH031zjB8LnIwoxz/view?usp=sharing

You are done

orefalo avatar Feb 01 '24 22:02 orefalo

@orefalo Protégé runs natively on M1 since version 5.6.0, released last year. There is no need to build or install a “modified” version. Just download the standard macOS build from the latest release. It’s a ”universal binary” containing code compiled for both the x86_64 and arm64 architectures, so it will run natively on both Intel-powered Macs and M1-powered Macs.

gouttegd avatar Feb 01 '24 23:02 gouttegd

that's right, figured it out too late. plz close

orefalo avatar Feb 04 '24 05:02 orefalo

Before closing, let’s answer the original question (two years later… sorry about that!) about JDK17: Protégé 5.6.x should work (on both arm-based and Intel-based Macs) with any Java version between 9 and 16 (included), but it will not work with Java 8 or Java ≥ 17. Some of the problems with Java 17 can indeed be worked around with some --add-opens options to the JVM, but there are other incompatibility issues that can’t be addressed so easily.

So for now, Java ≥ 17 is unsupported, and will remain so at least for the lifetime of the 5.6.x branch.

gouttegd avatar Feb 04 '24 11:02 gouttegd