Get java version from batch file

后端 未结 5 1342
悲&欢浪女
悲&欢浪女 2020-12-01 15:09

How to get java version and want to get \'6\' out of java version from batch file. I tried below script, but it didn\'t work.

    REM check java exists using         


        
5条回答
  •  日久生厌
    2020-12-01 15:37

    Within a block statement, %var% would be echoed as the value of var BEFORE the block was entered.

    Move the echo outside of the block or echo %%g or call echo %%javaver%% or invoke SETLOCAL enabledelayedexpansion and echo !javaver!

提交回复
热议问题