[fedora-java] Why no Class-Path manifest attribute?

David M. Lloyd david.lloyd at redhat.com
Wed May 29 13:30:31 UTC 2013


On Wed, 29 May 2013, Andrew Dinn wrote:

> On 29/05/13 10:30, Andrew Haley wrote:
>> On 05/29/13 10:13, Florian Weimer wrote:
>>> The existence of the Class-Path attribute is not widely known, and I was 
>>> surprised to see it mentioned in the policy.
>> 
>> Yes it is, it's very well-known, and is almost universally rejected.
>> It bakes hard paths into jarfiles and overrides -classpath.  In other
>> words, it has similar disadvantages to -RPATH.
>> 
>> It's not really suitable for any use, IMO.
>
> I was about post exactly the same response but Andrew beat me to it.
> I'll just underline
>
>  _very well-known_
>
>  _almost universally rejected_
>
> and
>
>   _not really suitable for any use_
>
> Hope that helps ;-)

I'd like to point out a few additional bits of information:

- Class-Path also works with relative paths
- Class-Path does not work in combination with -classpath, at all; it only 
works with -jar (and in containers which support it, of course)
- There is also an "installed extension" mechanism which is arguably not 
so great but is standard:
     http://docs.oracle.com/javase/7/docs/technotes/guides/extensions/spec.html
     http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html#Main_Attributes

Finally, I think it's worth mentioning that JBoss Modules is a class 
loading environment that allows complete specification of 
interdependencies which any Java application can take advantage of.  I 
would love to see Fedora use it.  Just sayin'. ;)

-- 
- DML


More information about the java-devel mailing list