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

Please add a module-info.java in order to make it a module. #16

Open
joehei opened this issue Mar 22, 2019 · 4 comments
Open

Please add a module-info.java in order to make it a module. #16

joehei opened this issue Mar 22, 2019 · 4 comments

Comments

@joehei
Copy link

joehei commented Mar 22, 2019

Please add a module-info.java in order to make it a module.

@lemire
Copy link
Owner

lemire commented Mar 22, 2019

Could you contribute a PR?

@joehei
Copy link
Author

joehei commented Mar 24, 2019

done :-)

@lemire
Copy link
Owner

lemire commented Mar 25, 2019

@joehei Thanks for the PR. It seems to break our tests... Presumably the issue is that it breaks backward compatibility with Java 8.

Many users are going to stick with Java 8. It seems unwise to break compatibility with Java 8. Is there a way around this?

@tkslaw
Copy link

tkslaw commented Oct 7, 2023

I believe the standard approach is to compile everything targeting Java 8, except for the module-info.java file, which should be compiled targeting Java 9+. Then package all the class files in a JAR and publish it.

If the library is used on Java 9+ and placed on the module-path, then the module-info file is used. Otherwise, if the code is placed on the class-path, or is used on Java 8, then the module-info file is ignored.

Note this is not the same thing as the multi-release JAR feature.

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

3 participants