Your minecraft files were compiled with Java 16 and you have installed and configured only version Java 8.
You need to install and configure Java 16: https://www.oracle.com/java/technologies/javase/jdk16-archive-downloads.html
Java 11 uses Class File Version 55
Java 8 uses Class File Version 52
This exception means that the java application or Java Class was compiled with Java 11
where Source and Target both compatibility was Java 11.
So to resovle this issue, there are 2 solutions.
1 - Use Java 11 for compilation and for execution.
2 - When compiling change the Target Compatibility to Java 8.
(This can be done in multiple ways.)
a) Command: javac -source 11 -target 8
b) Maven: <maven.compiler.target>1.8</maven.compiler.target>
c) Eclipse: Right Click on Project -> Properties -> Java Compiler -> Java Complience Level (Change to 1.8)
D) Intellij: File -> Project Structure -> Project -> Language Level (Change to 1.8)
your project java has an older version than the jar file you include
public class dog {
//new class dog. this will be an object int age;
String color;
String name;
public dog(){
/*this serves as the default
constructor*/
/*even without this constructor, the compiler creates this for every class*/ }
public int getage(){
return age;
}
public void setage(int a){
this.age = a;
}
public String getname(){
return name;
}
public void setname(String b){
this.name = b;
}
public String getcolor(){
return color;
}
public void setcolor(String c){
this.color = c;
}
}