Solved error '🖥compileJava' in fresh project of libGDX

I’ve just setup a new project of libGDX and i’ve ran into a problem:

Execution failed for task ':desktop:compileJava'.
> Could not resolve all files for configuration ':desktop:compileClasspath'.
   > Could not find lwjgl-glfw-3.3.3-natives-linux-arm32.jar (org.lwjgl:lwjgl-glfw:3.3.3).
     Searched in the following locations:
         file:/home/any/.m2/repository/org/lwjgl/lwjgl-glfw/3.3.3/lwjgl-glfw-3.3.3-natives-linux-arm32.jar
   > Could not find lwjgl-glfw-3.3.3-natives-linux-arm64.jar (org.lwjgl:lwjgl-glfw:3.3.3).
     Searched in the following locations:
         file:/home/any/.m2/repository/org/lwjgl/lwjgl-glfw/3.3.3/lwjgl-glfw-3.3.3-natives-linux-arm64.jar
   > Could not find lwjgl-glfw-3.3.3-natives-macos.jar (org.lwjgl:lwjgl-glfw:3.3.3).
......
//My build.gradle
    ext {
        appName = "My GDX Game"
        gdxVersion = '1.12.1'
        roboVMVersion = '2.3.20'
        box2DLightsVersion = '1.5'
        ashleyVersion = '1.7.4'
        aiVersion = '1.8.2'
        gdxControllersVersion = '2.2.1'
        lwjglVersion= '3.1.5'
    }

Solution turn out to be quite simple, since i was using newest version of gdx, there might have been some issues with it. So i tried to downgrade it to gdxVersion = '1.12.0', and the error gone away.

Here is all version of lwjgl and libGDX

You can use sudo update-alternatives --config java to switch to other version available if you meet some problems related to Java version. Check current version of Java by java -version

Also, i’m using VSCode for building and everything was marked in red when the i first opened it.


You can found the solution for it here.

A post was merged into an existing topic: Topic lưu trữ các post off-topic - version 3

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?