* 编译所有.java文件,并且放到bin目录下 * javac -d bin src/module-info.java src/com/itranswarpsample/*.java * 把bin目录下的class打包成jar * jar --create --file hello.jar(输出文件) --main-class com.itranswarp.sample.Main(Main定位) -C bin . (输入文件) * jar打包成jmod(打包jre) * jmod create --class-path hello.jar hello.jmod * java --module-path hello.jar --module hello.world //.jmod不能放在--module-path中 * jlink用来剔减模块 * jlink --module-path hello.jmod --add-modules java.base,xml,hello.world --output jre/ * 孕行 jre/bin/java --module hello.world * Hello.xml
jmod跟jar差不多,主要用来打jre
Sign in to make a reply
用户5289068359