batch file to run jar file with parameters

后端 未结 4 2054
南旧
南旧 2021-01-04 22:51

How can I run a batch file and pass parameters to jar file?

this doesn\'t work

mybat.bat

java -jar log_parser.jar %1 %2 %3 %         


        
4条回答
  •  死守一世寂寞
    2021-01-04 23:35

    In my case I use the following bat-file:

    @echo off
    PATH_TO_JRE\bin\java.exe -jar -Denable=true your_file.jar
    

    At this particular case then in java code I can get the param "enable" like this:

    Boolean.getBoolean("enable") 
    

提交回复
热议问题