Reputation: 265
I have java program compiled with java 1.7 and I need use this compiled file in another machine which contains java 1.6.
When I am running 1.7 java compiled file with java 1.6 "unsupported class version exception" getting.
Is their any backward compatibility to execute java 7 compiled file in java 1.6.
Upvotes: 1
Views: 1316
Reputation: 2068
There are some reason for exception.If you use library and it is not in jdk 1.6 it's problem for compile code in 1.6 because 1.6 does not contain libraries which is in 1.7
Upvotes: 0
Reputation: 9872
It will always fail when trying to check version number. Check your requirements and talk to your operators. If your only option is to run in a box with 1.6, then you should recompile and make sure you have all the information on your execution environment before running into any more problems when going real (for example, make sure you know about JDK provider, production machine dependent paths...)
Upvotes: 0
Reputation: 9474
Sorry, as far as I know, this is not possible. You can compile 1.6 compatible class files on JDK7, but you cannot run JDK7 class files on older virtual machines.
Upvotes: 1
Reputation: 39457
Upvotes: 0