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

Clean-up target/classes directory before compilation #90

Closed
ppkarwasz opened this issue Jan 5, 2024 · 2 comments · Fixed by #97
Closed

Clean-up target/classes directory before compilation #90

ppkarwasz opened this issue Jan 5, 2024 · 2 comments · Fixed by #97
Assignees
Labels
Milestone

Comments

@ppkarwasz
Copy link
Contributor

The javac compiler starts behaving differently if it finds module-info.class file from a previous compilation in the target directory: it tries to resolve the modules, but it fails since the module jars are on the classpath, not the modulepath:

error: module not found: org.apache.logging.log4j

Therefore we need to use a clean execution before each compile execution that will delete that file.

@ppkarwasz
Copy link
Contributor Author

A minimal reproducible example of the bug can be found here:

https://github.com/copernik-eu/bug-reproducibility/tree/main/javac-module-info-bug

@ppkarwasz
Copy link
Contributor Author

Apparently it is not a bug, it is a feature: https://bugs.openjdk.org/browse/JDK-8323757

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

Successfully merging a pull request may close this issue.

2 participants