First Time with Libgdx ( NetBeans user )

Hi Guys!
I downloaded the API and inserted the zip into the libraries.
Well, netbeans had issues finding the packages so i added each .jar separately.Well it kinda worked but, now this error happens :

CODE: SELECT ALL
run:
org.lwjgl.LWJGLException: Could not locate OpenAL library.
   at org.lwjgl.openal.AL.create(AL.java:151)
   at org.lwjgl.openal.AL.create(AL.java:102)
   at org.lwjgl.openal.AL.create(AL.java:201)
   at com.badlogic.gdx.backends.openal.OpenALAudio.<init>(OpenALAudio.java:70)
   at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:80)
   at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:64)
   at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:56)
   at Main.Main.main(Main.java:29)
Tyrian: Creating game
Tyrian: Resizing game to: 800 x 480
FPSLogger: fps: 61
FPSLogger: fps: 60
Tyrian: Pausing game
Tyrian: Disposing game
Java Result: -1
CONSTRUÍDO COM SUCESSO (tempo total: 2 segundos)

Im unsure on how to “install” or add this to my netbeans library, so i was wondering if anyone could give me a hand.
Ty

Ah, just to be clear, i know how to add libraries to my projects :stuck_out_tongue:

Im following a tutorial, this is the two classes that the tutorial are using :

package Main;

/**
 *

 */
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.FPSLogger;
import com.badlogic.gdx.graphics.GL20;
 
/**
 * The game's main class, called as application events are fired.
 */
public class Tyrian
    implements
        ApplicationListener
{
    // constant useful for logging
    public static final String LOG = Tyrian.class.getSimpleName();
 
    // a libgdx helper class that logs the current FPS each second
    private FPSLogger fpsLogger;
 
    @Override
    public void create()
    {
        Gdx.app.log( Tyrian.LOG, "Creating game" );
        fpsLogger = new FPSLogger();
    }
 
    @Override
    public void resize(
        int width,
        int height )
    {
        Gdx.app.log( Tyrian.LOG, "Resizing game to: " + width + " x " + height );
    }
 
    @Override
    public void render()
    {
        // the following code clears the screen with the given RGB color (green)
        Gdx.gl.glClearColor( 0f, 1f, 0f, 1f );
        Gdx.gl.glClear( GL20.GL_COLOR_BUFFER_BIT );
 
        // output the current FPS
        fpsLogger.log();
    }
 
    @Override
    public void pause()
    {
        Gdx.app.log( Tyrian.LOG, "Pausing game" );
    }
 
    @Override
    public void resume()
    {
        Gdx.app.log( Tyrian.LOG, "Resuming game" );
    }
 
    @Override
    public void dispose()
    {
        Gdx.app.log( Tyrian.LOG, "Disposing game" );
    }
}
package Main;

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.Audio;

/**
 *
 */

public class Main 
{

    public static void main(String args[])
    {
           // create the listener that will receive the application events
        ApplicationListener listener = new Tyrian();
 
        // define the window's title
        String title = "Tyrian";
 
        // define the window's size
        int width = 800, height = 480;
 
        // whether to use OpenGL ES 2.0
        boolean useOpenGLES2 = false;
        // create the game
        LwjglApplication lwjglApplication = new LwjglApplication( listener, title, width, height, useOpenGLES2 );
    
        
    }

}

Ok.
I found this :

Gonna try it and will post again afterwards.

Word of warning, that is Gustavo Steigert’s code, not yours, you should not put @author with your own name.

I hardly see any code.

I didnt do it on purpose. I create the class and netbeans already inserted it.
But thanks anyway.

Thanks for your help.

Anyone can give me a hand ?
I guess the image speaks for itself :

Link to full resolution : http://img833.imageshack.us/img833/3614/javagameerror.jpg

http://img833.imageshack.us/img833/3614/javagameerror.jpg

That is a file in gdx-natives.jar that libgdx extracts and then loads as a native.

Its there.But it doesnt work. I used the libgdx setup and tested it using its libs but still nothing.

Use eclipse:)

Err… i dont think the IDE is the issue…

Debug through LwjglNativesLoader and see if it extracts the OpenAL lib and sets the system property correctly. If it does, I don’t know why LWJGL can’t find it. libgdx just updated LWJGL to the latest.

This stupid library sucks.

Im hours awake trying to figure this crap out and nobody freaking answers in their forum. So screw this, im going sleep.

If anyone is able to figure this out, i will appreciate.

Oh well, before raging quitting i did this and the error stop occurring :

package Test1;

import org.lwjgl.*;
import com.badlogic.gdx.*;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.FPSLogger;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Audio;
import com.badlogic.gdx.Files;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.LifecycleListener;
import com.badlogic.gdx.Net;
import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.backends.jglfw.JglfwApplication;
import com.badlogic.gdx.backends.openal.OpenALAudio;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.Clipboard;
import com.badlogic.gdx.utils.GdxRuntimeException;

/**
 * This class simply creates a desktop LWJGL application.
 */
public class Main {

    public static void main(String[] args) {
        // create the listener that will receive the application events
        ApplicationListener listener = new Tyrian();

        // define the window's title
        String title = "Tyrian";

        // define the window's size
        int width = 800, height = 480;

        // whether to use OpenGL ES 2.0
        boolean useOpenGLES2 = false;
        
        // create the game
        Application app = new JglfwApplication(listener, title, width, height, useOpenGLES2);
        
    }
}

Wtf is JglfwApplication
Im sorry for the F word, but im freaking pissed.

Ehm, 7 hours before you started name calling I told you how to debug the issue. Needless to say I am not inclined to help you further. Pro tip: people that could help you are not required to care about your problems. It is actually much easier not to care.
https://code.google.com/p/libgdx/wiki/GettingHelp#Attitude

Google? I input JglfwApplication and get the javadoc:

http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/backends/jglfw/JglfwApplication.html

Which simply states it wraps around GLWF. So back to a google for “glwf”:

http://www.glfw.org/

About 10 seconds of effort.

You should consider going to do something that is not related to computers in any way before you hurt yourself.

Oh ty.

Sorry it was 2 AM in the morning and i was tired like hell.
Anyway, i made a ticket in their forum and i will re-install the JRE’s and JDK’s as well.

I did in Eclipse, and it didnt show any message.


import org.lwjgl.*;
import com.badlogic.gdx.*;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.FPSLogger;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Audio;
import com.badlogic.gdx.Files;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.LifecycleListener;
import com.badlogic.gdx.Net;
import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.openal.OpenALAudio;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.Clipboard;
import com.badlogic.gdx.utils.GdxRuntimeException;

/**
 * This class simply creates a desktop LWJGL application.
 */
public class Main {

    public static void main(String[] args) {
        // create the listener that will receive the application events
        ApplicationListener listener = new Tyrian();

        // define the window's title
        String title = "Tyrian";

        // define the window's size
        int width = 800, height = 480;

        // whether to use OpenGL ES 2.0
        boolean useOpenGLES2 = false;
        
        // create the game
        Application lwapp = new LwjglApplication(listener, title, width, height, useOpenGLES2);
        //Application app = new JglfwApplication(listener, title, width, height, useOpenGLES2);
        
    }
}

Err… so it was netbeans all along ? Weird stuff. Anyway, i will take this foward to them.

Ty u guys :stuck_out_tongue:

Ticket Created : https://netbeans.org/bugzilla/show_bug.cgi?id=229330

I actually had a solution (sort of) sorry i couldnt help with netbeans though :frowning: