Generally, I noticed that when my application's jar was compiled in a java version and running in some other java version the I get java.lang.UnsupportedClassVersionError
exception.
But my application uses jars of log4j
and tomcat
etc...
- Use any version of java why don't I get such exception?
- Is it possible to make my application's jar to behave same way?
try { ... } catch (UnsupportedClassVersionError e) { DisplayMessage("This application unfortunately only works on Java 7 and above. Please visit ... to install the latest version of Java."); }
.