LWJGL Lib issue

I decided it was time to get back to messing with JME, so I go through and update the CVS source, run a few tests, yay for me, like a charm. Then I try adding the JME jars and configuring the vm arguements for command line (yeah, using eclipse), and here's where I hit a problem, I get the unsatisfied link error, I think no problem, I just copy that lib folder into my project… but that doesn't do it, tried putting it everywhere.



I've seen a few recomendations to put the lib folder into the system folder but when it comes time to package things up i won't be able to test if the application runs properly. What could I be doing wrong here? I've had this working before and while I've historically had nightmares with the CVS side of things, usually the library path was easy.

Maybe you put a lwjgl on your projects build path that is incompatible with the lwjgl on the jME build path?

You can put lwjgl on your projects classpath (if you need to do lwjgl calls directly, else it's not needed) but if you do it's easiest to just point to the exact same jar (the one in the jme project).



In any case it's not a library path issue (library path refers to the location of native libraries, such as dlls on windows).

I had considered that and I did have a copy in another game project (the one that worked, at least before I transfered it to this computer). I already deleted it. I did a search to make sure and came up with a few more copies but it turned out they were in the recycle bin…



I am printing the java.library.path property and java.class.path property from my program, and it prints the below lines, note the last entry on the second line.


C:programmingjmelib
C:programmingMini Rolebin;C:programmingjmebin;C:programmingjmelibjinput.jar;C:programmingjmelibjogg-0.0.5.jar;C:programmingjmelibjorbis-0.0.12.jar;C:programmingjmeliblwjgl_fmod3.jar;C:programmingjmeliblwjgl.jar

If you're using eclipse and CVS, you do not have to use any external libs, nor set any vm arguments. Just put the libs included in CVS on the build path, and set their native library location.

I had tried a few times to get the project to act as a dependency, just tried again and now the jars work without having to use the external jars which is good. What's this about the native library location? I see the library option on the build path screen but I don't really think that's the right thing.

You can set this per library, just "expand" the library in the Java Build Path options, you'll see Source Attachment, Javadoc location, Native library location and Acces rules.



Source attachment is also very useful if you want to see what goes on inside lwjgl, just dl the source from their site, and point Eclipse to it.

Sorry, I just don't understand what you mean here.



Am I supposed to be trying to do this in the JME project, or my own project? Can you include explicit directions (what to click where). I appreciate the help but this is drivin me nuts.

The jME project, or anywhere else where you refer to the lwjgl jar.



Yay for a screenshot… I set that up, I had never noticed that before, I kept going into the add library area and wondering what was wrong.

The struggle continues… somewhere along the line it went from being an issue with the library path to being something different, I'm not sure where that happened and it's possible it's the issue from the start and I assumed it was libs because I could compile but not run. Anyway, this is really odd, like before I only have this issuing running my own project, not running something from in the jme project. I could have sworn there was a way to see what eclipse was using for the command line at one point so I could confirm that lwjgl.jar is in the classpath when it runs but I couldn't find the option. As far as I'm aware eclipse should have it in the path if it sees it for building but still I get this error somehow. Has the CVS version of LWJGL changed recently or anything like that.



Jul 4, 2006 11:13:07 PM com.jme.app.BaseGame start
INFO: Application started.
Jul 4, 2006 11:13:07 PM com.jme.system.PropertiesIO <init>
INFO: PropertiesIO created
Jul 4, 2006 11:13:07 PM com.jme.system.PropertiesIO load
WARNING: Could not load properties. Creating a new one.
java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException
   at com.jme.system.lwjgl.LWJGLPropertiesDialog.<init>(LWJGLPropertiesDialog.java:148)
   at com.jme.app.AbstractGame.getAttributes(AbstractGame.java:191)
   at com.jme.app.BaseGame.start(BaseGame.java:49)
   at com.dandeliongames.minirole.client3d.MRClient.main(MRClient.java:42)
Exception in thread "main" java.lang.NullPointerException
   at com.dandeliongames.minirole.client3d.MRClient.cleanup(MRClient.java:153)
   at com.jme.app.BaseGame.start(BaseGame.java:81)
   at com.dandeliongames.minirole.client3d.MRClient.main(MRClient.java:42)

This has driven me crazy I think, in the end, I reverted to good old fashioned brute force…



I copied the files from the target folder and the lib folder into my project, included the jar files, and the lib arguement in the vm, now it works. Trying to get eclipse to work right with this was a nightmare, I dunno what went wrong that I didn't use this setup before (I assume I tried to but failed and then found the 'proper' instructions for setup and followed that).



Now I can move on to the kind of typical newb questions I expect to have to ask, things about the API, or 3D math, not trouble with basic installation…



As a final note, I also closed the 'jme' project, when it's open, I get the same error. Maybe the problem all along is more a matter of having the actual classes there, and the jars available.



[edit]OK, I went into the properties for the jme project, it wouldn't let me turn off the 'export' for the source directory, but if you go to the source tab of the build path and then the source tab, click on the jme/src folder and delete it, no more problem. (I also got rid of my brute force copies of the jars). The draw back is before, errors in jme gave me the line of the source code, now they just report unknown source, but at least things run… seems like there is an option somewhere to point it to the source and maybe I can use that, though for the most part I assume the jme code is flawless and problems are always in my code…[/edit]

Well, the class / lib path seemed fine. No clue why it should not work, I've been using it like that forever (jme project with all the libs en native libraries set, and then another project that has the jme project on the build path). This was all in Eclipse 3.1, 3.2 is still giving me some weird issues also related to this type of thing.



But I can imagine why you'd want to just move on now… with whatever works.

I think my final solution was fairly inline with what should be done, the only disadvantage is if there is an exeption outside of my own code I won't have the line numbers, jME is mature enough that if that happens, I believe it's going to be a result of my own misunderstanding of what should happen anyway, and if not I'm pretty sure I could find out what line was the problem pretty easy (I may be able to set something so that it knows where the source is without having it exported). In the end my brute force method of simply copying the jars, is more likely to be typical of how my installer will work for the game itself.



It does seem awfully strange that it'd have a problem with the source and jar files both being in the path since the jars were built from the same source, but I just can't argue with the computer, it does what it wants, and I get to tolerate it :p. I wasn't aware that a new version of eclipse had come out… there is a certain undo buffer limit I'd like to be able to change…

If you want to work with the jme jars on the buildpath instead of the jme project, you can use source attachment (also seen in my screenshot) to at least see the source (I don't think you can edit it this way).



The problem with using the jars is you'll have to do a new ant build each time you update from CVS. But I guess you don't have to do that all the time, unlike me.

may or may not help but I put the build folder i.e my output location in the (build/…classpaths :|)of my projects, I never really build the jars anymore(javabuilder). I think build folder is a jme default/temp output location or something recommend by somebody…somewhere cant remember. long story short did u check the output location in your eclipse settings



p.s. if u build with the ant script to get the jars you must refresh jme to repopulate the build folder :?



hope that helps.

yep, I'm aware of those issues, it didn't matter.



Updating from CVS should be more of a once a release kind of thing for me, I don't really expect to do it more than once a month, it's no big deal to remember I need to build the jars, the hard part is to remember to tell it dist-all (I constantly find myself opening the xml file to look those up).