Created
February 1, 2019 22:47
-
-
Save fundter/d2cd7551cc818ceb8e77d5ebc2884535 to your computer and use it in GitHub Desktop.
Turn a non-modular jar into a modular jar (Java module)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate module-info.java | |
jdeps --generate-module-info <output-path-for-module-info.java> <path-to-non-modular-jar> | |
# Compile the module-info.java | |
javac --patch-module <name-of-the-module>=<path-to-non-modular-jar> <path-to-module-info.java> | |
# Update jar with module-info | |
cd <directory-containing-module-info.class> # avoid path prefix to module-info for next command | |
jar uf <path-to-non-modular-jar> module-info.class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment