Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java 8 can't use #547

Closed
jayzch opened this issue Dec 28, 2021 · 4 comments
Closed

java 8 can't use #547

jayzch opened this issue Dec 28, 2021 · 4 comments

Comments

@jayzch
Copy link

jayzch commented Dec 28, 2021

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/mvndaemon/mvnd/client/DefaultClient 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

@jayzch
Copy link
Author

jayzch commented Dec 28, 2021

➜ mvnd git:(master) ✗ java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (Zulu 8.58.0.13-CA-macos-aarch64) (build 1.8.0_312-b07)
OpenJDK 64-Bit Server VM (Zulu 8.58.0.13-CA-macos-aarch64) (build 25.312-b07, mixed mode)

@Achieve777
Copy link

Yes, The minimum runtime environment is jdk 11

@ppalaga
Copy link
Contributor

ppalaga commented Jan 4, 2022

I guess you are trying use mvnd on Apple M1 and because there is no native executable for that platform, you use the mvnd.sh script?
Well, yes, the mvnd client module is the only one from the mvnd family that requires Java 11. For the Daemon and all its dependencies, Java 8 is enough. I further assume that you really want to run your build on Java 8 (because otherwise, you could just use Java 11 for both client and Daemon).

So to run your build on Java 8, you somehow need to reach that the client process uses Java 11+ and the Daemon uses Java 8.

An easy and dirty solution that comes to my mind would be to hardcode JAVACMD in mvnd.sh to your Java 11 java executable and make sure that JAVA_HOME env var points at Java 8.

Maybe @gnodet knows of a better solution?

@gnodet
Copy link
Contributor

gnodet commented Jan 4, 2022

mvnd works on Apple M1 provided the rosetta layer is installed, see #337 (comment)
It can be installed using

softwareupdate --install-rosetta

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

No branches or pull requests

4 participants