Error when a 4.X Java Agent is Run on Java 6 or 7

  • Updated


Contrast Java agent versions 4.x are no longer compatible with JVM versions prior to Java 8.


Contrast Java agent versions 4.x are compiled to classfiles with version 52, the version first released with the Java 8 JDK. When a JVM version prior to Java 8 attempts to launch an application including version 52 classfiles, it recognizes that the classfile format is a version that it does not understand and the application will shut down with an error similar to the following:

Exception in thread "main" java.lang.UnsupportedClassVersionError:
com/contrastsecurity/agent/ContrastLoaderAgent :
   Unsupported major.minor version 52.0
       at java.lang.ClassLoader.defineClass1(Native Method)
       at java.lang.ClassLoader.defineClass(
       at Method)
       at java.lang.ClassLoader.loadClass(
       at sun.misc.Launcher$AppClassLoader.loadClass(
       at java.lang.ClassLoader.loadClass(
       at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(
       at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(
FATAL ERROR in native method: processing of -javaagent failed


If such an error is encountered then either:

  1. The JVM used to launch the application should be updated to at least Java 8

  2. Contrast Java agent version 3.x should be used instead of the version 4.x agent.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request