LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Falc on April 03, 2011, 23:32:40

Title: Bulid problems with LWJGL and Eclipse
Post by: Falc on April 03, 2011, 23:32:40
Hello!

I'm pretty new to Java (moved over from C++) and after including the "lwjgl.jar" and the "lwjgl_util.jar" and run the project in eclipse I get this error :

usage:
XPMFile <file>
java.lang.ArrayIndexOutOfBoundsException: 0
at org.lwjgl.util.XPMFile.main(XPMFile.java:260)


Google didn't helped and now I hope you guys can.  :-\

I use Vista x64 and the last eclipse, jdk and lwjgl verison (downloaded everything today).

Falc
Title: Re: Bulid problems with LWJGL and Eclipse
Post by: kappa on April 03, 2011, 23:57:49
what sort of code are you running? could be a problem in your code.
Title: Re: Bulid problems with LWJGL and Eclipse
Post by: Falc on April 04, 2011, 05:58:59
I just included the files and didn't used the libs in the code yet.
package en.geron.first;

public class Main {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Hello Eclipse!");
}

}

Title: Re: Bulid problems with LWJGL and Eclipse
Post by: kappa on April 04, 2011, 08:45:54
odd how you can even get that error when your not even calling any code from your code.

How and where did you add the lwjgl.jar and lwjgl_util.jar's?
Title: Re: Bulid problems with LWJGL and Eclipse
Post by: broumbroum on April 04, 2011, 09:55:56
use netbeans (http://www.netbeans.org), it's fairly easier !
I found eclipse very complex (and slow on a 2G RAM Windows) some time ago.
Title: Re: Bulid problems with LWJGL and Eclipse
Post by: Endolf on April 04, 2011, 12:25:01
Quote from: broumbroum on April 04, 2011, 09:55:56
use Vi (http://www.kernel.org/), it's fairly easier !
I found eclipse very complex (and slow on a 2G RAM Windows) some time ago.
Troll.

As kappa points out, that error makes no sense. I would suggest your run profile is pointing at the wrong class, you should be able to just right click on your class and select run as java application.

Endolf
Title: Re: Bulid problems with LWJGL and Eclipse
Post by: KittenKoder on April 04, 2011, 13:06:49
Since it's Windows I would also recommend checking your paths. In Eclipse you may also need to set the paths in the user libraries, I did in mine, under "Native library location" for each jar in the listing.
Title: Re: Bulid problems with LWJGL and Eclipse
Post by: Endolf on April 04, 2011, 13:24:23
That's later on in the process, but yeah, the other way to do it is to add -Djava.library.path=<directory of the dlls> on the run profile.

Endolf