While running my program I'm getting this error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: TestaContador : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
These are my classes:
- Conta.java :
public class Conta {
static int contador;
Conta() {
Conta.contador ++;
}
}
- TestaContador.java:
public class TestaContador {
public static void main(String[] args) {
System.out.println (" Contador : " + Conta.contador);
System.out.println (" Contador : " + Conta.contador);
System.out.println (" Contador : " + Conta.contador);
}
}