tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 56676] New: Normalize access to native library
Date Thu, 26 Jun 2014 22:20:49 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=56676

            Bug ID: 56676
           Summary: Normalize access to native library
           Product: Tomcat 8
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: gael.lalire@laposte.net

Docs seems to advice using $CATALINA_HOME/lib but you could also imagine
$CATALINA_HOME/native directory.

What I wish is to avoid having a JVM launching with special options
(java.library.path).
To achieve that you should use System.load and System.mapLibraryName instead of
System.loadLibrary.

A code sample if $CATALINA_HOME/lib is the normalized native directory:
{code}
        File nativeLib = new File(System.getProperty("catalina.home"), "lib");
        for (int i = 0; i < NAMES.length; i++) {
            try {
                System.load(new File(nativeLib,
System.mapLibraryName(NAMES[i])).getPath());
                loaded = true;
            }
{code}


It is useful if the tomcat instance is not running at JVM start but embedded
and launched later.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message