LWJGL / lwjgl3

LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan, bgfx), audio (OpenAL, Opus), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR, OpenXR) applications.
https://www.lwjgl.org
BSD 3-Clause "New" or "Revised" License
4.76k stars 636 forks source link

java.lang.NoClassDefFoundError: org/lwjgl/Version #760

Closed tank-sman closed 2 years ago

tank-sman commented 2 years ago

Question

hi every game i want to made in eclipse this error show up java.lang.NoClassDefFoundError: org/lwjgl/....... for example trying a version printer: the code: ########################################### import org.lwjgl.Version;

public class MainApp { public static void main(String[] args) { System.out.println(Version.getVersion()); } } ########################################### Error: ########################################### Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/Version at main.MainApp.main(MainApp.java:5) Caused by: java.lang.ClassNotFoundException: org.lwjgl.Version at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ... 1 more ###########################################

tank-sman commented 2 years ago

also packages are installed

httpdigest commented 2 years ago

Did you add the LWJGL 3 jars to the modulepath or to the classpath? This is a typical problem starting with Java 9, where - in besides the classpath you now have the modulepath. And Eclipse will (when you answer with "yes" in the new project wizzard about whether it should create a module file) create a module-info.java file. In this case, your application is a module and you must also declare the dependencies in your module-info.java file.