Limit modules added by javapackager

前端 未结 2 1671
温柔的废话
温柔的废话 2021-02-15 16:48

I am trying to reduce the size of my application by limiting the modules that it includes. I already did this for my runtime using jlink. However, when I run

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-15 17:05

    Using the command line javapackager, you can make use of the deploy options --limit-modules and --add-modules such as:-

    javapackager -deploy 
        --add-modules java.base,java.desktop... 
        --limit-modules java.base,java.desktop,java.naming...
        --module-path your.mods.dir
        -native -outdir OUTPUT_DIR -outfile APPLICATION_NAME 
        -srcdir PACKAGE_SRC_DIR -srcfiles APPLICATION.jar -appclass MAIN_CLASS
        -name "YourApplication" -title "SelfContained"
    

    Or colloquially a deploy ant task would consist of something like:-

    
        
        
        
        
        
        
    
    

提交回复
热议问题