Bug 102 - Fail to find cgShader environment with webstart
Summary: Fail to find cgShader environment with webstart
Status: VERIFIED FIXED
Alias: None
Product: Jogl
Classification: JogAmp
Component: core (show other bugs)
Version: 1
Hardware: All windows
: P3 normal
Assignee: Sven Gothel
URL: http://www.javagaming.org/cgi-bin/JGN...
Depends on:
Blocks:
 
Reported: 2004-08-06 01:00 CEST by Sven Gothel
Modified: 2010-03-24 07:46 CET (History)
0 users

See Also:
Type: DEFECT
SCM Refs:
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2010-03-24 07:46:50 CET


---- Reported by xerxes 2004-08-06 13:00:08 ----

There are some difficulties to loade native libraries (in this case cg.dll and
cgGL.dll for the cgShader environment). These native libraries are not directly
called upon by the java application, but by jogl.dll. When one native library
(jogl.dll in this case) calls on another native library (cg.dll or cgGL.dll) the
search seems to be conducted in the system path of the OS (i.e. ./ and
windows/system32) and not in the java.library.path.

The result is that applications using jogl and cgShaders must have cg.dll and
cgGL.dll in the root path of the application, that is ./ or in windows/system32.
This can be solved by putting the dlls in ./ when running the application from
the command line, even though it isn't a fancy solution. However the problem
becomes larger when using webstart, sine webstart can not locate these dlls even
if they are jar-ed, signed and given as native libraries in the jnlp file.

There are some solutions that I can think of:

1. Always load these files from the application
System.loadLibrary("cg");
System.loadLibrary("cgGL");
This way they are allready loaded in the memory when jogl.dll wants to find
them. This is the solution that I'm using and it works.
 
2. Try to install those files in the system path. Keep in mind that system path
can differ on different systems (even if it is the same OS).
 
3. Incorporate cgShader environment dlls (cg.dll and cgGL.dll) in jogl.dll.

4. Write to Santa and wish that future releases of the JavaVM conducts the
library search in java.library.path before the system path of the OS when a
native library calls upon another native library. This allows the user to have
another version of for example cgShader environment installed on the computer
while the java application uses the tested version that has been shipped with it.



---- Additional Comments From kbr 2005-01-31 00:57:43 ----

Incorporated suggestion from submitter to call System.loadLibrary() on
cg and cgGL before calling System.loadLibrary() on jogl_cg. Hopefully
this will help Java Web Started applications by allowing the person
doing the deployment to also deploy the Cg runtime environment if
desired.




--- Bug imported by sgothel@jausoft.com 2010-03-24 07:46 EDT  ---

This bug was previously known as _bug_ 102 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=102