JEP 238: Multi-Version JAR Files

Peter Levart peter.levart at gmail.com
Sat Feb 14 14:56:51 UTC 2015


On 02/12/2015 09:52 PM, Paul Sandoz wrote:
> Hi
>
> In connection with the JEP there is also a design document to help the discussion:
>
>    http://cr.openjdk.java.net/~psandoz/jdk9/MultiVersionJar-8u60-9-design.md
>
> We are especially interesting in hearing feedback from library developers, tool/IDE developers, and anyone doing funky stuff with class loading and JAR files.
>
> Paul.
>
> On Feb 12, 2015, at 9:41 PM, mark.reinhold at oracle.com wrote:
>
>> New JEP Candidate: http://openjdk.java.net/jeps/238
>>
>> - Mark

Hi Paul,

I read through the proposal and couldn't find an explanation of how 
resources placed in versioned paths are going to be visible. For 
example, if the multi-versioned jar contains the following structure:

my.properties
META-INF/versions/8/my.properties
META-INF/versions/9/my.properties


What will the following code return, when run on JDK9:

URL[] urls = 
ClassLoader.getSystemClassLoader().getResources("my.properties");

Will we only get 1 URL: META-INF/versions/9/my.properties
or 3 URLs in order: META-INF/versions/9/my.properties, 
META-INF/versions/8/my.properties, my.properties

Class name -> .class file resolving is easy, since only the 1st one is 
used, but there can be multiple general resources for same path.

Regards, Peter




More information about the core-libs-dev mailing list