ZincCompiler error

Hi guys,
I’m working on migration to Gatling 2.0 form Gatling 2.0.0-M3a. I’ve followed the migration guide.
Now I get this error during Engine run

java.lang.UnsupportedClassVersionError: io/gatling/app/ZincCompiler : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: io.gatling.app.ZincCompiler. Program will exit.
Exception in thread “main” Compilation failed

and i can figure out what is wrong

Hi Anastasia,

Are you sure the JDK you use to run Gatling is at least a JDK7u6, as specified in the migration guide?
It looks like you’re using a JDK 6 instead.

Cheers,

Pierre

hi Pierre,

thank you for the quick response.

I double-checked JDK version and tried with 1.7.0.51 initially and now on 1.7.0.67 still have the same result.

is there any other guess what can cause this error?

No, there’s no mistake: a JDK6 is picked up.
Try setting JAVA_HOME.

I had a simular issue. The engine class has to be updated (disableCompiler class I believe)

Unsupported major.minor version 51.0 means that you’re trying to run some JDK7 bytecode with an older JDK.

  • either you haven’t installed a JDK7+
  • or you’ve set a JAVA_HOME that still targets a JDK6-
  • or you’re running on OSX where java resolution is just crazy and you HAVE to set a JAVA_HOME env if there’s a JDK6 lingering somewhere.
    This is one of the first things we explain in the documentation: http://gatling.io/docs/2.0.0/quickstart.html#installing

Agreed. Major.minor stuff is always related to the wrong Jdk being used.

Still- the second issue, zinc compiler class not found - I got around that by using disableCompiler
That must have changed sometime this autumn?

Stefan

“Could not find the main class” is caused by the JVM not being able to load the class. That’s a consequence of the first Exception.

A few months ago, when we decided to target JDK7, we forgot during a few days to change Zinc’s target. It was still JKD6, so it was failing to compile the Simulations as they depended on JDK7 libraries such as… Gatling. You got hit at this time, and we quickly fixed the problem.

Stéphane,

Pierre
Thank you for your help.
issue was resolved by updating JAVA_home variable.