5
While running my program I am 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:
- Java account.:
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);
}
}
In what package (
package
) your class is locatedConta
?– Edilson
src --> (default package)
– user37114
Moves the class
Conta
for the packagetestcontador
, or creates a package with a different name.– Edilson
The same mistake continues.
– user37114
Apparently it was an eclipse mistake.
– user37114
You solved the problem ?
– Edilson