Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

Difficulty running on an M1 Mac #346

Open
stkgo opened this issue Mar 23, 2022 · 5 comments
Open

Difficulty running on an M1 Mac #346

stkgo opened this issue Mar 23, 2022 · 5 comments

Comments

@stkgo
Copy link

stkgo commented Mar 23, 2022

I'm running on an M1 Mac with Zulu's jdk8 release. I can run make build and it completes without errors, however when I run make run I get see the following:

docker-compose up
[+] Running 2/0
 ⠿ Container nf-tower-backend-1   Created                                                                                                         0.0s
 ⠿ Container nf-tower-frontend-1  Running                                                                                                         0.0s
Attaching to nf-tower-backend-1, nf-tower-frontend-1
nf-tower-backend-1   | OpenJDK 64-Bit Server VM warning: Unable to open cgroup memory limit file /sys/fs/cgroup/memory/memory.limit_in_bytes (No such file or directory)
nf-tower-backend-1   | Error: A JNI error has occurred, please check your installation and try again
nf-tower-backend-1   | Exception in thread "main" java.lang.UnsupportedClassVersionError: io/seqera/tower/Application has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
nf-tower-backend-1   | 	at java.lang.ClassLoader.defineClass1(Native Method)
nf-tower-backend-1   | 	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
nf-tower-backend-1   | 	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
nf-tower-backend-1   | 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
nf-tower-backend-1   | 	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
nf-tower-backend-1   | 	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
nf-tower-backend-1   | 	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
nf-tower-backend-1   | 	at java.security.AccessController.doPrivileged(Native Method)
nf-tower-backend-1   | 	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
nf-tower-backend-1   | 	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
nf-tower-backend-1   | 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
nf-tower-backend-1   | 	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
nf-tower-backend-1   | 	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)
nf-tower-backend-1 exited with code 1

Running which java correctly identifies zulu8.60.0.21-ca-jdk8.0.322-macosx_aarch64/bin/java and java -version shows:

openjdk version "1.8.0_322"
OpenJDK Runtime Environment (Zulu 8.60.0.21-CA-macos-aarch64) (build 1.8.0_322-b06)
OpenJDK 64-Bit Server VM (Zulu 8.60.0.21-CA-macos-aarch64) (build 25.322-b06, mixed mode)

Is there any guidance on how to run Tower on an M1 Mac?

@stkgo
Copy link
Author

stkgo commented Mar 24, 2022

I'm encountering this same issue when building with Adoptium's Temurin 8 OpenJDK distribution.

@varontron
Copy link

I had a similar error on m1, with three versions of java, but not jdk8. To resolve:

brew tap homebrew/cask-versions
brew install --cask temurin8
JAVA_INSTALL_DIR=/Library/Java/JavaVirtualMachines/temurin-8.jdk
JAVA_BIN_DIR=${JAVA_INSTALL_DIR}/Contents/Home/bin
JAVA_VSN=$(${JAVA_BIN_DIR}/java -version 2>&1|head -1|tr -d '"'|awk '{ print $3 }')
export JAVA_HOME=$(/usr/libexec/java_home -v ${JAVA_VSN})
make build
make run

@pditommaso
Copy link
Contributor

You should use jdk11 or later (up to 17). Best way to install Java is https://sdkman.io/

@varontron
Copy link

Thanks @pditommaso. The README in this repo states Java 8 as a requirement, but I guess it's just a minimum requirement, which is great, but perhaps this could be stated explicitly.

The critical config, as one would expect, seems to be the use of the same jdk for build and run steps. Personally, for dubious reasons, I did not have JAVA_HOME set at build time, and my default configs led to the error.

@pditommaso
Copy link
Contributor

My mistake, Java 8 should work

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants