Command to Check JRE Version
java -version
command to test version and 32 bit or 64 bit java is installed.
|
Example
D:\>java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
D:\>
|
-showversion and -version:<version> options
java -showversion is the alias option for the -version. Manual version can specify to run the java program. Can use -version:<1.0> to run the java file as version 1.0 java program.
|
Example to run with specific version
java:javac Example.java
java:java -version:1.4 Example
Error: Unable to locate JRE meeting specification "1.4"
java:java -version:1.5 Example
Error: Unable to locate JRE meeting specification "1.5"
java:java -version:1.6 Example
Error: Unable to locate JRE meeting specification "1.6"
java:java -version:1.0 Example
Error: Unable to locate JRE meeting specification "1.0"
java:java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
java:java -version:1.7 Example
Welcome to Java
java:
|