Loading a library

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.


13 points

To the mighty programmers over here: can anyone respond bk explaining how can i make a library load before anything is loaded. what would be the code for it?

Thanks



6 points

try using a static block to load this library before anything gets called.

Example

class Test { 
static {
System.loadLibrary("path-to-library-file");
}
....
} 

When you call new Test(), the static block will be called first before anything gets called.

Hope this helps !

Anonymous's picture
Created by Anonymous

Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.