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

error: has been compiled by a more recent version #79

Closed
andrewarrow opened this issue Oct 30, 2022 · 1 comment
Closed

error: has been compiled by a more recent version #79

andrewarrow opened this issue Oct 30, 2022 · 1 comment

Comments

@andrewarrow
Copy link

andrewarrow commented Oct 30, 2022

Tried to run ./gradlew -p samples installDist from README and got:

> Task :mosaic:mosaic-runtime:compileKotlin FAILED
e: java.lang.UnsupportedClassVersionError: 
androidx/compose/compiler/plugins/kotlin/ComposeComponentRegistrar
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

Found https://stackoverflow.com/questions/47457105/class-has-been-compiled-by-a-more-recent-version-of-the-java-environment

Researching this now, will post an update here if I solve it.

@andrewarrow
Copy link
Author

Found this one helpful:

https://stackoverflow.com/questions/21964709/how-to-set-or-change-the-default-java-jdk-version-on-macos

Couple different ways to do it. I ended up installing android studio to get java11 and then added:

cd /Library/Java/JavaVirtualMachines
ln -s /Applications/Android\ Studio.app/Contents/jre java11

all I add in JavaVirtualMachines directory before was adoptopenjdk-8.jdk.

Once I added java11 and set:

export JAVA_HOME="/Library/Java/JavaVirtualMachines/java11/Contents/Home"

Then ./gradlew -p samples installDist worked without error.

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

1 participant