Saturday, July 25, 2009

JDK and JRE version conflict: major.minor version 50.0

The error mentioned above in the post heading is a frequent arrival when different version of jdk and jre conflict. This error occurs when somebody compiles a program with higher version of javac and tries to run with lower version of jre or vice-versa.

For example:

#javac -version
javac 1.6_0_10

#java -version
java version "1.3.1_01"
java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)

Solution - Temp

1. Download Jre1.6 or whatever version same as the javac version.
2. Manually set path to the new jre.
3. open a command window and type

#set path="C:\Program Files\Java\jre1.6_0_10\bin";

3. Now, for this session of the cmd window whenever you invoke java -- new jre will be invoked.