Hot questions for Using Lightweight Java Game Library in netbeans


is it possible to put the lwjgl display onto a canvas created in a Jframe Form? I'm using the Netbeans IDE v8.2 and lwjgl 2.9.3. Thanks for the help! Heres some of my code from the DisplayManager which is called from the MainLoop.

public class DisplayManager{

private static final int WIDTH = 800;
private static final int HEIGHT = 600;
private static final int FPS_CAP = 120;

private static long lastFrameTime;
private static float delta;

public static void createDisplay() {

    ContextAttribs attribs = new ContextAttribs(3,2).withForwardCompatible(true).withProfileCore(true);

    try { 

        Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
        Display.create(new PixelFormat(), attribs);
        Display.setTitle("Coffee Beans V1");
        new EditorGUI().setVisible(true);

    } catch (LWJGLException e) {

    lastFrameTime = getCurrentTime();



Yes, via org.lwjgl.opengl.Display.setParent(java.awt.Canvas).


I know this may seem like a duplicate but throughout the examples I have seem I must be doing something wrong still.

I am using Netbeans 8.0.

Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
    at java.lang.ClassLoader.loadLibrary(
    at java.lang.Runtime.loadLibrary0(
    at java.lang.System.loadLibrary(
    at org.lwjgl.Sys$
    at Method)
    at org.lwjgl.Sys.doLoadLibrary(
    at org.lwjgl.Sys.loadLibrary(
    at org.lwjgl.Sys.<clinit>(
    at org.lwjgl.opengl.Display.<clinit>(
    at org.newdawn.slick.AppGameContainer$
    at Method)
    at org.newdawn.slick.AppGameContainer.<clinit>(
    at Engine.main(

Is my error which i know from research is just the path isn't set. I went into Properties > Libraries and i have a Library LWJGL which has multiple .jar's in it, including lwjgl.jar. I also have gone to Properties > Run which is where i believe my problem is. I have made a folder in C:\LWJGL\ that contains the lwjgl.jar aswell. My VM Options are -Djava.library.path=C:\LWJGL\.

I know i must be missing something here in regards to where is it looking for the native files or something? After reading through other posts i think my problem is the location of the native files.


java.library.path takes the path to the natives (extensions .dll, .so, .dylib), not the jar file. You have to point it directly to the folder where you have stored these files; it won't work when they are in a subfolder. The LWJGL zip file you downloaded will most likely contain a native folder that contains these files.


Im currently using LWJGL 2.9.1 and im getting this error. I've included the libraries and natives in the netbeans library manager.

The jars and dll's are stored



I've went into the VM Options and added this line as instructed on other Q&As but still no help :(


I've also tried without the quotation marks



Accordingly to rmail2006's comment, I've made it works following these steps:

Go to project properties -> Run, and edit "VM Options":