Can't use LWJGL in Netbeans 6.7.1 (Windows XP)

Started by simplychaos, September 07, 2009, 08:08:52

Previous topic - Next topic

simplychaos

I found this topic:

http://lwjgl.org/forum/index.php/topic,2848.0.html

And followed what it said, but it doesn't work. It just says "package org.lwjgl does not exist".

If I remove the library and add the source for lwjgl to my source path, most of the errors go away, but it still says it's missing:

import org.lwjgl.opengl.GL11;

I'm trying to get the newdawn.org spaceinvaders demo with LWJGL working. It recognizes those packages fine when they're in my source path, but not the LWJGL ones. One twist to this, is I'm actually trying to do this in Scala, but the imports don't even work! The newdawn code is recognized just fine though so I don't think it's an issue with Scala.

I've been messing with this for days, trying to get OpenGL to work somehow in Scala. Tried using this too: http://code.google.com/p/scalagl/
which uses JOGL and can't get it to work either. There are missing packages that I can't find anywhere (javax.media.opengl). I'm a fairly experiences programmer (but a Java/Scala newb) and I'm really pulling my hair out on this one. I have checked the paths a million times and tried everything I can think of, HELP!

Also, the demo I'm trying to get to work uses some AdvancedTimer (they refer to it as GAGE timer), which is not provided with the source. There's a link but it's dead (the page just says "It Works"). Anyone know where to find it?

simplychaos

Ok so I got it working in Eclipse. It's roughly the same process, but for whatever reason Netbeans just doesn't recognize the libraries, even though when I start typing "import org." it will come up and say "lwjgl", etc... Then it still tells me the package doesn't exist! So my advice to anyone trying to get LWJGL, JOGL, or probably any other library (slick & fenggui wouldn't work either) working in Netbeans, DON'T USE NETBEANS! I would think it's just my installation is screwed up somehow, but it compiles plain Scala programs fine, just won't let you use libraries in any way, shape or form. And I am compiling with Scala in Eclipse too. Long live Scala and Eclipse!

Oh and I found the GAGE timer after reading this post:

http://forums.sun.com/thread.jspa?threadID=5390738

I didn't know web.archive.org archived files! Always thought it was just the pages...

Ciardhubh

Quote from: simplychaos on September 07, 2009, 19:22:28
Ok so I got it working in Eclipse. It's roughly the same process, but for whatever reason Netbeans just doesn't recognize the libraries, even though when I start typing "import org." it will come up and say "lwjgl", etc... Then it still tells me the package doesn't exist! So my advice to anyone trying to get LWJGL, JOGL, or probably any other library (slick & fenggui wouldn't work either) working in Netbeans, DON'T USE NETBEANS!

If that is your reason not to use Netbeans, you are missing out on the better IDE for this kind of work in my opinion. If you cannot get any library to work, that's an indication you might have to change the way you do it.

simplychaos

Yeah I know, it's unfortunate, because it's supposed to be better for Scala, but I spent 3 days trying to get it to work and no luck. It's seems to generally be more buggy than Eclipse. Netbeans doesn't recognize that I put source files in my src directory sometimes. I'm new to Java/Scala, but not to programming, but generally adding JARs was confusing. I first selected add folder/jar and added the whole folder with the lwjgl jars. They all show up, I can see the packages and everything in the left bar, but it won't recognize any of them when compiling. So then I try it the way it was described in that other post, adding a library group or whatever, then adding that library and the dll path in the VM arguments. Nothing. I try adding JARs individually as libraries and adding the VM path. Nothing. The only way it will recognize any packages is if I put the full source in my source directory. I even tried doing THAT with lwjgl, but then it says some classes are missing (GL11?) ! I tried recompiling after every library change too.

I'm not saying Netbeans doesn't work at all, just that for whatever reason it doesn't work for me and it's really not worth weeks of my life. By all means, people should try Netbeans with Scala and see if it works loading libraries (mine worked with just Scala source), but if it doesn't it could be Netbeans and not you... I tried for 3 days, and then 15 minutes with Eclipse and it works.

Ciardhubh

Hard to tell what went wrong as there a lots of small things that can go wrong. On some rare freak occasions I had to restart Netbeans for some errors to go away; clean and build usually worked too.

QuoteIt's seems to generally be more buggy than Eclipse.

That's why I switched from Eclipse, because for me Eclipse was more buggy. Netbeans was more of an integrated solution from one provider instead of a myriad of plugins, each with their own conflicting dependencies.

Quote from: simplychaos on September 07, 2009, 21:40:19
I even tried doing THAT with lwjgl, but then it says some classes are missing (GL11?) ! I tried recompiling after every library change too.

That's probably because classes like GL11 are not in the "java" source tree of LWJGL. They were generated automatically and are in the the "generated" source tree.

padam1989

That link doesn't provide full steps. Here is the full detailed steps to setup lwjgl with netbeans http://www.gaanza.com/blog/setting-up-lwjgl-with-netbeans/. And please netbeans is a very good ide. :)
Gracias.