jmod request

Jonathan Gibbons Jonathan.Gibbons at Sun.COM
Thu Dec 10 13:07:37 PST 2009


jmod is currently not friendly to being invoked directly from Java code.

It would be nice to be able to avoid unnecessary execs when running jmod 
from Java.  Here are some issues and corresponding suggestions:

-- Librarian.run currently calls System.exit. 
        It is generally better to have run methods like this either 
throw exceptions or give an integer return code.   Either way, the 
condition should be caught in main, and the corresponding System.exit 
should be called there. (Generally, "main" is the only reasonable place 
to call System.exit)

-- Librarian directly calls System.out and System.err
       It would be better to be able to pass it streams (or Writers) to 
use.  The streams can default to System.out and System.err if the user 
does not provide anything.

In the short term, it would be nice to have a method like
    class Librarian {
        static int run(String[] args, Writer out)

   }

Longer term, we should look at providing an Ant task and/or JSR 199 API.

-- Jon



More information about the jigsaw-dev mailing list