[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian java policy and modular jar files



Hi Emanuel,

Thanks for your reply.

On Tue, 2019-01-22 at 09:17 +0100, Emmanuel Bourg wrote:
> Hi Bill,
> 
> Le 22/01/2019 à 01:09, Bill Zaumen a écrit :
> 
> > the following commands will cause java to crash:
> > 
> >       java -p /usr/share/java --list-modules
> > 	java -p /usr/share/java --describe-module MODULE
> 
> I don't think this is a use case we can reasonably support. Even if
> there were no symlinks in /usr/share/java it isn't rare to see two
> incompatible versions of the same jar there. If such jars are modular
> 'java --list-modules' would complain too (modules aren't versioned
> unfortunately).

You can tag modular jar files with a version number that the
command java --list-modules recognizes, but that version number is set
when the JAR file is created (a jar option named --module-version sets
this value).  In the listing, the version number appears after an '@'
symbol, but it is not used when an application is running or during
compilation.  Unfortunately, the java --list-modules and
--describe-module options are broken: java exits after an exception is
thrown instead of merely noting a conflict or listing both versions.

I mentioned this as an indication of why one might want a directory
for the most recent versions of these jar files.
> 
> 
> > The question is whether there is a standard location for modular
> > JAR files.  I found a PDF file suggesting /usr/share/java/modules
> > but that document is quite a few years old and I couldn't find any
> > other documents corroborating that suggestion.
> 
> What would be the benefit of installing modular jars in a common
> directory such as /usr/share/java/modules?

What one could put into such a directory would be symbolic links to the
latest version of a modular jar file in /usr/share/java.  Then that
directory can appear on an application's module path. It would save
application developers the effort of having to track down which jar
files to use and then setting up symbolic links from some application-
specific directory.  If you don't want to do that, it is worth pointing
out that such directories should be set up by application developers or
package maintainers - otherwise people can end up spending a lot of
time trying to make sure they didn't miss something.

Bill


Reply to: