java 9 module practice To run this project follow the below process 👍
- Clone or download this project
- Go to folder java9
- Open bash or command prompt
- Create directory mods by run command
mkdir ./mods
- Run following command to compile java files to class files
javac --module-source-path ./src -d ./mods $(find src -name '*.java')
- Now class files created inside mods folder. so we need to create mlib folder for jar files. Run following command
mkdir mlib
- Run following command to create jar file
jar --main-class=com.flop.client.WelcomeClient --create --file=mlib/com.flop.client@1.0.jar --module-version=1.1 -C mods/com.flop.coder . -C mods/com.flop.client .
- So jar file will be created at mlib folder
- Run jar file using following command
java -jar mlib/com.flop.client@1.0.jar
That's All. Thank You.