I am trying to run a small batch file with the following lines to print the output of java version.
@echo off
set instDir=%cd%
set JAVA_DIR="%instDir%\bin\jre\bin\java.exe"
%JAVA_DIR% -version > output.txt
When I run (double click) this file with "*.bat" extension, nothing is written to the output.txt.
When I execute the same file from command prompt, it prints the version on command prompt, but does not print to the file.