So I have been programming a bit with java for a while, and I started on making games, as I'm not super experienced with it I decided to make a simple 2D game. It was going pretty good until I met a problem: (can't embed pictures yet, but basically it says as in my title.

This is the code I have been using for the Application that received the error:
import java.awt.EventQueue;
import javax.swing.JFrame;
public class Application extends JFrame {
public Application() {
initUI();
}
private void initUI() {
add(new Board());
setSize(250, 200);
setTitle("Application");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
}
public static void main(String[] args) {
EventQueue.invokeLater(() -> {
Application ex = new Application();
ex.setVisible(true);
});
}
}
Anyone know why I got that error and how to fix it?
in IDEA File -> Project Structure
select JDK 8+
choose language level at least 8.
(Of course you will need to download new JDK if you have no Java 8 capable JDK)
If you use maven or gradle, you change in
pom.xml(see below) and update project settings from pom.xmlFor gradle see docs, as it changes often with newer gradle versions https://docs.gradle.org/current/userguide/building_java_projects.html