Problem loading jogl_cg with Java WebStart

I am having a problem loading the jogl_cg native lib when running my app via Java WebStart. I have the following lines…

System.loadLibrary(“jogl”);
System.loadLibrary(“jogl_cg”);

And when I load the jnlp file, the OS complains because it can’t find the shared library “cg”. I would assume that the _ character is screwing this up.

If I don’t load the jogl_cg then everything works fine (I am not yet using any cg specific code). But I need to get this figured out for future purposes.

Thanks.

Does it work if you rename jogl_cg to joglcg for example (renaming the .dll file too of course) ?

I thought the way to specify native libraries with JWS is using the tag:

for example.

Do you hardcode the System.loadLibrary inside your code? Isn’t better to try using the .jnlp file to load the libraries?

I had some troubles with webstart in linux, because it complained about finding the library files but in windows everything worked ok. (in linux, I had to extract the files from the .jar and place them in the codebase of the .jnlp file) Hope I’m making some sense :wink:

I was under the impression I still needed to do a System.loadLibrary in my application. I will comment these lines out and see if it works without them.

I don’t think renaming the dll is a good idea because doesn’t the jogl.jar have a static link to that file? Therefor renaming it might blow up jogl?

Thanks.

Well, I tried it out without the System.loadLibrary and it worked. Cool. That’s even better. Thanks.

Let me know if you run into problems using the Cg library from Java Web Start. I think there may be a problem with how that library is bundled on Windows and Linux; jogl_cg.dll / libjogl_cg.so may need to go into its own jar file (it’s in the same jar file as jogl.dll / libjogl.so right now).

There is another problem with attempting to use Cg from Java Web Start, which is that the Cg library (and all of the demos we’ve ported) prefers to load programs from files on disk (cgCreateProgramFromFile). We need to write a wrapper which reads all of the data from an InputStream into a String and then calls cgCreateProgram with that String.