Запуск задачи Gradle.run () работает нормально, из идеи "UnsatisfiedLinkError: Не удалось найти библиотеку: lwjgl.dll" - PullRequest
0 голосов
/ 05 ноября 2019

Под названием: если я запускаю пример из задачи run, предоставляемой плагином application, то все работает нормально.

Но если я запускаю нажатие кнопки воспроизведения в Idea, то получаю:

"C:\Program Files\Java\ojdk-11.0.4.11-1\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 193.4099.13\lib\idea_rt.jar=56503:C:\Program Files\JetBrains\IntelliJ IDEA 193.4099.13\bin" -Dfile.encoding=UTF-8 -p C:\Users\gbarbieri\IdeaProjects\v\build\classes\java\main;C:\Users\gbarbieri\IdeaProjects\v\build\resources\main;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.3.50\b529d1738c7e98bbfa36a4134039528f2ce78ebf\kotlin-stdlib-1.3.50.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-glfw\3.2.3\5e520d5c290c8b012545a8d34fa5db5ab051ea53\lwjgl-glfw-3.2.3.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-jemalloc\3.2.3\b6fd0932171ba3f2eaa4547beddca3a3e645342d\lwjgl-jemalloc-3.2.3.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-openal\3.2.3\106742e805803ab9eab8e343f0fb31a3d263903c\lwjgl-openal-3.2.3.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-opengl\3.2.3\bdd534a323d0c8f54969b95e424b6ac8984f7d6e\lwjgl-opengl-3.2.3.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-glfw\3.2.3\b4d8a3477cdc2edcf7a5f1e822926be846223f54\lwjgl-glfw-3.2.3-natives-windows.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-stb\3.2.3\40eccaa4fa86fc815f2e17946a392fb5fdcc286a\lwjgl-stb-3.2.3.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-jemalloc\3.2.3\3423fd0d4c7c1916c8f46b2075c4c2df02f22675\lwjgl-jemalloc-3.2.3-natives-windows.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-vulkan\3.2.3\34a69f76173952424e85943a2dc7d9efd3d8ff9c\lwjgl-vulkan-3.2.3.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-shaderc\3.2.3\3612d4ed5466d100b7cf31f188530c3bdaa23145\lwjgl-shaderc-3.2.3.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-openal\3.2.3\ec898e8ce11b5886f4f532a1536283ef2817758d\lwjgl-openal-3.2.3-natives-windows.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl\3.2.3\17a59ba0fe8d474ec9dbe0d5db40d2cfe59c4c08\lwjgl-3.2.3.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib-common\1.3.50\3d9cd3e1bc7b92e95f43d45be3bfbcf38e36ab87\kotlin-stdlib-common-1.3.50.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.jetbrains\annotations\13.0\919f0dfe192fb4e063e7dacadee7f8bb9a2672a9\annotations-13.0.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-opengl\3.2.3\e81cfc73ec8708e5e791ed770e4ec3edfc1bbab1\lwjgl-opengl-3.2.3-natives-windows.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-stb\3.2.3\817b21ec286f0ba3dcedb56a3bd275e6a9345be9\lwjgl-stb-3.2.3-natives-windows.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-shaderc\3.2.3\7743c77f38d298e466bdd201a0fce24bd43d0fb1\lwjgl-shaderc-3.2.3-natives-windows.jar;C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl\3.2.3\27f32cd35349684745951e04388e8e00d681cdcd\lwjgl-3.2.3-natives-windows.jar -m untitled.main/cmon.TriangleKt
[LWJGL] Failed to load a library. Possible solutions:
    a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.
    b) Add the JAR that contains the shared library to the classpath.
[LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics.
[LWJGL] Enable the SharedLibraryLoader debug mode with -Dorg.lwjgl.util.DebugLoader=true for better diagnostics.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to locate library: lwjgl.dll
    at org.lwjgl/org.lwjgl.system.Library.loadSystem(Library.java:162)
    at org.lwjgl/org.lwjgl.system.Library.loadSystem(Library.java:62)
    at org.lwjgl/org.lwjgl.system.Library.<clinit>(Library.java:50)
    at org.lwjgl.glfw/org.lwjgl.glfw.GLFW.<clinit>(GLFW.java:674)
    at untitled.main/cmon.TriangleKt.main(Triangle.kt:23)
    at untitled.main/cmon.TriangleKt.main(Triangle.kt)

Process finished with exit code 1

но lwjgl.dll фактически включено (последний аргумент: C:\Users\gbarbieri\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl\3.2.3\27f32cd35349684745951e04388e8e00d681cdcd\lwjgl-3.2.3-natives-windows.jar)

build.gradle здесь здесь

Я включаю lwjgl иего родной, как я всегда делал много раз:

    ext.lwjglVersion = "3.2.3"
    ["", "-glfw", "-jemalloc", "-openal", "-opengl", "-stb", "-vulkan", "-shaderc"].each {
        implementation "org.lwjgl:lwjgl$it:$lwjgl_version"
        if(it != "-vulkan")
            runtime "org.lwjgl:lwjgl$it:$lwjgl_version:natives-$lwjgl_natives"
    }

Ради любопытства я также попробовал простой способ, как предложено на официальном сайте:

    ext.lwjglVersion = "3.2.3"
    ext.lwjglNatives = "natives-windows"

        implementation "org.lwjgl:lwjgl:$lwjglVersion"
        implementation "org.lwjgl:lwjgl-assimp:$lwjglVersion"
        implementation "org.lwjgl:lwjgl-bgfx:$lwjglVersion"
        implementation "org.lwjgl:lwjgl-glfw:$lwjglVersion"
        implementation "org.lwjgl:lwjgl-nanovg:$lwjglVersion"
        implementation "org.lwjgl:lwjgl-nuklear:$lwjglVersion"
        implementation "org.lwjgl:lwjgl-openal:$lwjglVersion"
        implementation "org.lwjgl:lwjgl-opengl:$lwjglVersion"
        implementation "org.lwjgl:lwjgl-par:$lwjglVersion"
        implementation "org.lwjgl:lwjgl-stb:$lwjglVersion"
        implementation "org.lwjgl:lwjgl-vulkan:$lwjglVersion"
        implementation "org.lwjgl:lwjgl-shaderc:$lwjglVersion"
        implementation "org.lwjgl:lwjgl-jemalloc:$lwjglVersion"
        runtimeOnly "org.lwjgl:lwjgl:$lwjglVersion:$lwjglNatives"
        runtimeOnly "org.lwjgl:lwjgl-assimp:$lwjglVersion:$lwjglNatives"
        runtimeOnly "org.lwjgl:lwjgl-bgfx:$lwjglVersion:$lwjglNatives"
        runtimeOnly "org.lwjgl:lwjgl-glfw:$lwjglVersion:$lwjglNatives"
        runtimeOnly "org.lwjgl:lwjgl-nanovg:$lwjglVersion:$lwjglNatives"
        runtimeOnly "org.lwjgl:lwjgl-nuklear:$lwjglVersion:$lwjglNatives"
        runtimeOnly "org.lwjgl:lwjgl-openal:$lwjglVersion:$lwjglNatives"
        runtimeOnly "org.lwjgl:lwjgl-opengl:$lwjglVersion:$lwjglNatives"
        runtimeOnly "org.lwjgl:lwjgl-par:$lwjglVersion:$lwjglNatives"
        runtimeOnly "org.lwjgl:lwjgl-stb:$lwjglVersion:$lwjglNatives"
        runtimeOnly "org.lwjgl:lwjgl-shaderc:$lwjglVersion:$lwjglNatives"
        runtimeOnly "org.lwjgl:lwjgl-jemalloc:$lwjglVersion:$lwjglNatives"

Ни за что, всегда одна и та же ошибка

Чего мне не хватает?

Ps: module-info.java:

module untitled.main {

    requires org.lwjgl;
    requires org.lwjgl.shaderc;
    requires org.lwjgl.vulkan;
    requires org.lwjgl.glfw;
    requires org.lwjgl.jemalloc;
}
...