native cmds and libs in the module library

Chris Hegarty chris.hegarty at oracle.com
Mon Dec 12 08:46:25 PST 2011


Hi,

I've been looking into where native commands and native libraries get 
installed in the modules library. Today the files in the NATIVE_LIBS and 
NATIVE_CMDS sections of jmod files [1] are installed into directories in 
the the module library. This is not ideal for a few reasons:

1. Native commands hidden down in modules directory are not easy to
    find, and complicates the PATH.

2. One native library may have a dependency on another, which
    complicates the LD_LIBRARY_PATH. Again, having to poke around
    in the modules directory of each module.

3. JDK images cannot be built with simple jmod create/install. This
    would be nice! Currently, in the build native libs and cmds are
    copied into place.

4. At some point you could imagine it would be desirable to install
    native commands into /usr/bin.

I've prototyped changes to the SimpleLibrary where, at the point of 
creation (jmod create), you can optionally specify a path for native 
libs and cmds. The creator of the library can decide where these get 
installed. Then, when a jmod file is installed the native cmds and libs 
are placed in the libraries appropriate directory.

If 'jmod create' is called without these optional arguments then the 
current behavior is maintained, native libs and cmds are installed in 
each module under its 'lib' and 'bin' directories, respectively. I think 
this behavior may be desirable in some cases, a module has a single 
native library that implements some platform specific operation.

http://cr.openjdk.java.net/~chegar/jigsaw/libbin_webrev.00/webrev/

Open issues: impact on native deb packages when natlibs/cmds is 
specified outside of the module library.

Thanks,
-Chris.

[1] http://cr.openjdk.java.net/~mr/jigsaw/notes/module-file-format/



More information about the jigsaw-dev mailing list