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

Changing JVM version compilation failure #825

Closed
dwijnand opened this issue Jul 10, 2020 · 3 comments
Closed

Changing JVM version compilation failure #825

dwijnand opened this issue Jul 10, 2020 · 3 comments

Comments

@dwijnand
Copy link
Member

I'm not sure if this is a bug in stable, released Zinc, or just in Zinc's own build, but whenever I switch from Java 11 to 8 I get:

[info] Compiling 1 Java source to /d/zinc/internal/zinc-persist/target/jvm-2.13/classes ...
[error] /d/zinc/internal/zinc-persist/src/main/java/xsbti/compile/FileAnalysisStore.java:14:1: cannot access xsbti.compile.analysis.ReadWriteMappers
[error]   bad class file: /d/zinc/internal/zinc-persist/target/jvm-2.13/classes/xsbti/compile/analysis/ReadWriteMappers.class
[error]     class file has wrong version 55.0, should be 52.0
[error]     Please remove or make sure it appears in the correct subdirectory of the classpath.
[error] xsbti.compile.analysis.ReadWriteMappers
[error] (zincPersistJVM2_13 / Compile / compileIncremental) javac returned non-zero exit code

Any ideas?

@retronym
Copy link
Member

retronym commented Jun 2, 2021

Arguably when Zinc detects the JVM has been changed it should throw away all class files from the previous compile. Do not pass them on the classpath to scalac/javac, do not try to analyse them itself, do not collect $200.

@retronym
Copy link
Member

retronym commented Jun 2, 2021

Likely the same issue as sbt/sbt#2074 ?

@jackkoenig
Copy link

jackkoenig commented Aug 1, 2023

I recently ran into a similar issue and resolved it by passing java.vendor.version as an extra argument. It's similar to what SBT currently does: sbt/sbt#2074 (comment), but a little bit stricter since changing vendors or minor version will also trigger a full recompilation using java.vendor.version as opposed to java.class.version.

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