I have to send the java version to a text file as below
C:\>java -version > C:\cfn\log\JavaVersion.log
But when i open the check the file, its completely Empty. I get the version immediately at the below line as-
C:\>java -version > C:\cfn\log\JavaVersion.log
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
How do i fix this?