gurkenlabs / litiengine

LITIENGINE 🕹 The pure 2D java game engine.
https://litiengine.com/
MIT License
718 stars 94 forks source link

class file has wrong version 65.0, should be 61.0 #812

Closed poach3r closed 4 months ago

poach3r commented 4 months ago

Describe the bug In IntelliJ IDEA Ultimate Edition, I can successfully add the LITIENGINE library and use it in my project without seeing any syntax errors, however it fails to compile. This happens regardless of build system used.

// ./src/Main.java
import de.gurkenlabs.litiengine.Game;

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello world!");
        Game.init(args);
        Game.start();
    }
}

Stack Trace

java: cannot access de.gurkenlabs.litiengine.Game
  bad class file: /$MAVEN_REPOSITORY$/de/gurkenlabs/litiengine/0.8.0/litiengine-0.8.0.jar!/de/gurkenlabs/litiengine/Game.class
    class file has wrong version 65.0, should be 61.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

To Reproduce Steps to reproduce the behavior:

  1. Install jetbrains.idea-ultimate from nixpkgs
  2. Create a new project
  3. Import any LITIENGINE version
  4. Use LITIENGINE in your project
  5. Build the project

Expected behavior The project should compile without any errors.

Screenshots If applicable, add screenshots to help explain your problem.

Your System:

github-actions[bot] commented 4 months ago

Thank you for your reporting your first LITIENGINE issue! We are looking forward to your further contributions.

Hades948 commented 4 months ago

Looks like you're using jdk 17, which uses class version 61. Litiengine 0.8.0 was built on jdk 21, which uses class version 65. You probably just need to be using jdk 21.

poach3r commented 4 months ago

The docs say that JDK 17 is the lowest version which works, "Since LITIENGINE has been created with Java 17, you need at least JDK 17 on your machine.", I will install JDK 21 and report back.

Hades948 commented 4 months ago

Oh, gotcha. It used to be 17, so we probably missed updating the documentation. Can you provide a link to where you found that? Then we can probably keep this issue open as a doc issue.

poach3r commented 4 months ago

I've tried it again with Adoptium 21 and it fixed the issue, I found the error in question at https://litiengine.com/docs/getting-started/install-jdk/

nightm4re94 commented 4 months ago

Thank you for reporting and sorry for the outdated documentation. We'll fix this ASAP.

nightm4re94 commented 4 months ago

@Hades948 has updated the docs. Thank you!