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
Within a block statement, %var% would be echoed as the value of var BEFORE the block was entered.
var
Move the echo outside of the block or echo %%g or call echo %%javaver%% or invoke SETLOCAL enabledelayedexpansion and echo !javaver!
echo
%%g
call echo %%javaver%%
SETLOCAL enabledelayedexpansion
echo !javaver!