简体   繁体   中英

I'm trying to run LWJGL 3 in Eclipse and it keeps showing this error message

When I try to use LWJGL 3, the console shows this

I tried to find fixes for this earlier, I reinstalled Eclipse twice and removed and added back the LWJGL 3 files into its user library and nothing seems to make it work.

I downloaded the Zip Bundle from the LWJGL website, Zip Bundle with preset "Getting Started" for windows x86. I downloaded the latest stable build of Release, 3.2.3 build 13

I followed the 1.2 Installation guide here: https://github.com/LWJGL/lwjgl3-wiki/wiki/1.2.-Install#eclipse

but still, I got the error message as linked on the first line.

I ran the sample code for HelloWorld from the LWJGL website. here: https://www.lwjgl.org/guide

Edit: making it clearer

Here is the command line from Run Configurations:

>C:\Users\Me\.p2\pool\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_15.0.2.v20210201-0955\jre\bin\javaw.exe -Dfile.encoding=Cp1252 -classpath "C:\Users\Me\Documents\LWJGL\lwjgl.jar;C:\Users\Me\Documents\LWJGL\lwjgl-assimp.jar;C:\Users\Me\Documents\LWJGL\lwjgl-assimp-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-assimp-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-assimp-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-bgfx.jar;C:\Users\Me\Documents\LWJGL\lwjgl-bgfx-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-bgfx-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-bgfx-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-glfw.jar;C:\Users\Me\Documents\LWJGL\lwjgl-glfw-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-glfw-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-glfw-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nanovg.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nanovg-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nanovg-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nanovg-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nuklear.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nuklear-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nuklear-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nuklear-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-openal.jar;C:\Users\Me\Documents\LWJGL\lwjgl-openal-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-openal-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-openal-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-opengl.jar;C:\Users\Me\Documents\LWJGL\lwjgl-opengl-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-opengl-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-opengl-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-par.jar;C:\Users\Me\Documents\LWJGL\lwjgl-par-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-par-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-par-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-stb.jar;C:\Users\Me\Documents\LWJGL\lwjgl-stb-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-stb-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-stb-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-vulkan.jar;C:\Users\Me\Documents\LWJGL\lwjgl-vulkan-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-vulkan-sources.jar;C:\Users\Me\eclipse-workspace\helloworld\bin"


-XX:+ShowCodeDetailsInExceptionMessages helloworld.helloworld

Judging from the list of the jar names in the classpath, you have selected/downloaded the wrong architecture (x86) of the natives, as opposed to x64 (amd64, x86_64).

You are running a 64-bit JVM (a 64-bit process) and with that, LWJGL tries to load its 64-bit native files, which it cannot find on the classpath, because only the differently-named 32-bit native are on the classpath.

The jars with the natives for 32-bit have -x86 in their names. The natives which you need (64-bit ones) do not have that suffix.

So, to fix this, load the zip file from https://www.lwjgl.org/customize and specify "Windows x64" under section "Natives".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM