Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] Eclipse linkage help!

Started by squirrel_of_death Jul 11, 2004 at 2:20 PM 12 replies 3.2k views
Original Post
squirrel_of_death
squirrel_of_death
Hi everyone, I'm quite mystified at the moment, as I have recently made the move to Java using Eclipse as my IDE. Yesterday, I was happy developing my app using jogl for graphics. Then I downloaded an applet plugin so that I could view this site, and voila, my IDE was screwed. I've googled my eyes out all day now, so I'm finally asking you guys for help. Here are the symptoms. I'm using : Eclipse 3.0 j2sdk1.4.2_04 j2re1.4.2_05 jogl.Jar in folder j2re1.4.2_05\lib\ext jogl-natives-win32.Jar in same folder jogl.dll in folder j2re1.4.2_05\bin, also in Windows\System32 jogl_cg.gll in same folders I uninstalled my JRE, and reinstalled. Eclipse continues to give me these red errors : java.lang.UnsatisfiedLinkError: dispatch_wglGetExtensionsStringARB at net.java.games.jogl.impl.windows.WindowsGLImpl.dispatch_wglGetExtensionsStringARB(Native Method) at net.java.games.jogl.impl.windows.WindowsGLImpl.wglGetExtensionsStringARB(WindowsGLImpl.java:33366) etc, there are around 20 of them. I know it's trying to link to the native GL calls. I just have no idea how to fix it. Clicking on any of the errors, I get message above : Source not found. the jar file jogl.jar has no source attachment. Hopefully you Java dudes will know what I'm talking about, as this looks to me like a basic linkage problem. Thanks!
Rickmeister
Rickmeister
Don't know really, because I haven't used extensions that much, but if you press "next" when starting a new project, after you've named it, hit the tab called "libraries" and there is a button named "Add JARs" and "Add Externals JARs".. Might be the solution..
squirrel_of_death
squirrel_of_death
This is still stalling my GL work, and while a fresh install of Eclipse might be the answer, I feel this is something I should know how to do properly. As I said, I DL'd a plugin for my JRE, and suddenly this happened. I'm not personally calling the wglGetExtensionsStringARB function, so it's very unexpected.
OrthoDiablo
OrthoDiablo
UnsatisfiedLinkageError means that jre cannot find dll or so file that contains the native implentation of functions. Make sure that all the libraries that come with jogl are in your classpath.
I dont remember the exact steps to add classpaths to the Eclipse Project but I am sure its in the documentation.
Give a man a fish and you feed him for a day; teach him to use the Net and he won't bother you for weeks.
squirrel_of_death
squirrel_of_death
Well, as far as I can see, the jogl.jar and jogl-natives-win32.jar is fine, it's in the build path and all. It must be the direct link to the DLL's, and all the options I have tried don't seem to be working.
OrthoDiablo
OrthoDiablo
DLLs must also be in the classpath.
Give a man a fish and you feed him for a day; teach him to use the Net and he won't bother you for weeks.
Aldacron
Aldacron
Native libraries must be in the library path, not the class path. When you run a project from Eclipse, enter the run options dialog and add -Djava.library.path= as a command line argument. Also, having the jars and dlls spread around your system like that is not a good idea. I suggest you store them all in a central location (not in any JRE or Windows system directory - I have mine in C:\dev\java\libs, for example). This will avoid conflicts when you install a new JRE/SDK or a different version of jogl. And one more thing, jogl-natives-win32.jar contains the jogl DLL files, so if it is on the library path you don't need the dlls separately. It's packaged up that way for use in webstart apps.

When you distribute your jogl apps, make sure you include the jogl jars with it. If you install a jogl app that does not include the jogl files, just run it with the -cp and -Djava.library.path options pointing to the folder that contains your local jogl copies.
squirrel_of_death
squirrel_of_death
Aldacron, thank you for your advice. However, it's still not working. Here's what I've done.

In the Run console, there are 2 windows for arguments : Program arguments, and VM arguments. When I put the following :

-Djava.library.path=
-Djava.library.path=

as VM arguments, I get the error : java.lang.UnsatisfiedLinkError: no jogl in java.library.path

when I put them in the Program arguments, I get the original error above, java.lang.UnsatisfiedLinkError: dispatch_wglGetExtensionsStringARB.

Now, when I removed the dll's from Windows/system32, I got the same error as 1) above : java.lang.UnsatisfiedLinkError: no jogl in java.library.path. So I put them back, that is as expected the library path.

What am I doing wrong?
BobV
BobV
The quick and dirty to get up and working would be to remove the dlls from the jar and drag them right into your project.

You'll at least be able to continue working.

You can then worry about your pathing at a more convient time.
squirrel_of_death
squirrel_of_death
Well, after a complete re-install of JDK/RE + Eclipse, the problem persisted. Guess what. *sob* I must have downloaded one of the newer jogl.jar files, that was beta. Replacing that with an older version from online, I'm back in business. Thank you all for your time! So much appreciated.
Aldacron
Aldacron
Quote:
Original post by squirrel_of_death
-Djava.library.path=
-Djava.library.path=


Let me explain this a little more clearly.

First, perhaps I should have explicitly stated that the brackets are not needed. -Djava.library.path= was an example. Using brackets to indicate text which should be replaced is common syntax.

Second, java classes go on the *classpath*, not the library path. The library path is for *native libraries only*.

Third, while putting jogl-natives-win32.jar directly on the library path might work (not sure as I've never put a jar directly on the lib path) the point I was making is that you put the path to the dlls on the library path, not the hars or dlls themselves.

So, the end result should look like this:

-Djava.library.path=D:\java\jogl\includes

No brackets, no file names.

Quote:

I must have downloaded one of the newer jogl.jar files, that was beta. Replacing that with an older version from online, I'm back in business


That sounds a little suspicious to me. You *should* be using the very latest version (which is 1.1b03 released April 29th). And I'm pretty sure that wglGetExtensionStringARB has not been removed from the library, which is the only thing that would have caused that error. More likely the root of the problem was something else.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.