Hot questions for Using Lightweight Java Game Library in netbeans

Question:

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");
        Display.setParent(EditorGUI.canvas1);
        new EditorGUI().setVisible(true);



    } catch (LWJGLException e) {
       e.printStackTrace();
    }

    GL11.glViewport(0,0,WIDTH,HEIGHT);
    lastFrameTime = getCurrentTime();

}

Answer:

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

Question:

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(ClassLoader.java:1865)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1119)
    at org.lwjgl.Sys$1.run(Sys.java:73)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
    at org.lwjgl.Sys.loadLibrary(Sys.java:95)
    at org.lwjgl.Sys.<clinit>(Sys.java:112)
    at org.lwjgl.opengl.Display.<clinit>(Display.java:132)
    at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:36)
    at Engine.main(Engine.java:33)

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.


Answer:

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.

Question:

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

"C:\Users\Tom\Documents\NetBeansProjects\LWJGLTest\lib\natives"

"C:\Users\Tom\Documents\NetBeansProjects\LWJGLTest\lib\jars"

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

Djava.library.path="C:\Users\Tom\Documents\NetBeansProjects\LWJGLTest\lib\natives"

I've also tried without the quotation marks

Djava.library.path=C:\Users\Tom\Documents\NetBeansProjects\LWJGLTest\lib\natives


Answer:

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

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

-Djava.library.path="/path/to/your/lwjgl/lib/natives/macosx"