Re: Multi-Release JAR runtime support

2016-04-22 Thread mark . reinhold
2016/4/22 5:39:26 -0700, paul.san...@oracle.com:
> On 20 Apr 2016, at 02:11, mark.reinh...@oracle.com wrote:
>> 2016/4/19 12:37:41 -0700, Hervé BOUTEMY :
>>> Perhaps this requirement should be described in
>>> http://openjdk.java.net/jeps/238
>> 
>> Yes -- that was certainly non-obvious!
>> 
>> Steve, could you please add this to the JEP?  (A JEP should, in general,
>> contain and/or refer to enough information for an experienced developer
>> to get started using the feature.)
> 
> The description is updated:
> 
>   https://bugs.openjdk.java.net/browse/JDK-8047305
> 
> including two new sections on compatibility and resource URLs.

Excellent, thanks!

(FYI, http://openjdk.java.net/jeps/* is now updated every 15 minutes
 from JBS rather than irregularly, as before.)

- Mark


Re: Multi-Release JAR runtime support

2016-04-22 Thread Paul Sandoz

> On 20 Apr 2016, at 02:11, mark.reinh...@oracle.com wrote:
> 
> 2016/4/19 12:37:41 -0700, Hervé BOUTEMY :
>> that's it: I added this Multi-Release: true attribute configuration in the
>> demo and now it works like a charm, thank you
>> 
>> Perhaps this requirement should be described in
>> http://openjdk.java.net/jeps/238
> 
> Yes -- that was certainly non-obvious!
> 
> Steve, could you please add this to the JEP?  (A JEP should, in general,
> contain and/or refer to enough information for an experienced developer
> to get started using the feature.)
> 

The description is updated:

  https://bugs.openjdk.java.net/browse/JDK-8047305 


including two new sections on compatibility and resource URLs.

Paul.


Re: Multi-Release JAR runtime support

2016-04-19 Thread Steve Drach
Yes.

> On Apr 19, 2016, at 5:11 PM, mark.reinh...@oracle.com wrote:
> 
> 2016/4/19 12:37:41 -0700, Hervé BOUTEMY :
>> that's it: I added this Multi-Release: true attribute configuration in the 
>> demo and now it works like a charm, thank you
>> 
>> Perhaps this requirement should be described in 
>> http://openjdk.java.net/jeps/238
> 
> Yes -- that was certainly non-obvious!
> 
> Steve, could you please add this to the JEP?  (A JEP should, in general,
> contain and/or refer to enough information for an experienced developer
> to get started using the feature.)
> 
> Thanks,
> - Mark



Re: Multi-Release JAR runtime support

2016-04-19 Thread mark . reinhold
2016/4/19 12:37:41 -0700, Hervé BOUTEMY :
> that's it: I added this Multi-Release: true attribute configuration in the 
> demo and now it works like a charm, thank you
> 
> Perhaps this requirement should be described in 
> http://openjdk.java.net/jeps/238

Yes -- that was certainly non-obvious!

Steve, could you please add this to the JEP?  (A JEP should, in general,
contain and/or refer to enough information for an experienced developer
to get started using the feature.)

Thanks,
- Mark


Re: Multi-Release JAR runtime support

2016-04-19 Thread Hervé BOUTEMY
that's it: I added this Multi-Release: true attribute configuration in the 
demo and now it works like a charm, thank you

Perhaps this requirement should be described in 
http://openjdk.java.net/jeps/238

Is it expected to be supported with JDK 8 also? Is there any magic trick to 
add this feature to a normal JDK 8?

Regards,

Hervé

FYI, here is the output now:

Archive:  multirelease/target/multirelease-0.8-SNAPSHOT.jar
testing: META-INF/MANIFEST.MF OK
testing: base/Base.class  OK
testing: mr/A.class   OK
testing: META-INF/versions/9/mr/A.class   OK
testing: META-INF/versions/8/mr/A.class   OK
No errors detected in compressed data of multirelease/target/multirelease-0.8-
SNAPSHOT.jar.
$ unzip -p multirelease/target/multirelease-0.8-SNAPSHOT.jar META-
INF/MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven 3.3.9
Built-By: herve
Build-Jdk: 9-ea
Multi-Release: true

[...]

# Run Multi Release JAR with JRE 7
$ java -classpath multirelease/target/multirelease-0.8-SNAPSHOT.jar base.Base
1.7.0_71-b14
BASE

# Run Multi Release JAR with JRE 8
$ java -classpath multirelease/target/multirelease-0.8-SNAPSHOT.jar base.Base
1.8.0_25-b17
BASE

# Run Multi Release JAR with JRE 9 classic
$ java -classpath multirelease/target/multirelease-0.8-SNAPSHOT.jar base.Base
9-ea+114
FROM BASE -> NINE

# Run Multi Release JAR with JRE 9 Jigsaw
$ java -classpath multirelease/target/multirelease-0.8-SNAPSHOT.jar base.Base
9-ea+114-2016-04-15-162029.javare.4859.nc
FROM BASE -> NINE



Le mardi 19 avril 2016 08:46:36 Alan Bateman a écrit :
> On 19/04/2016 02:49, Hervé BOUTEMY wrote:
> > But the unexpected part is that JRE 9, either classical or jigsaw, don't
> > take advantage of the MR JAR: is this really expected, or did I do
> > something wrong?
> Hervé - can you dump the manifest? It's not clear from your mail that it
> has the Multi-Release attribute.
> 
> -Alan



Re: Multi-Release JAR runtime support

2016-04-19 Thread Steve Drach
Hi Herve,

I checked the jar file created from your code and, as others have suspected, 
the manifest does not contain the “Multi-Release” attribute.  I added the 
attribute with emacs and tried it out:

$ java -classpath multirelease/target/multirelease-0.8-SNAPSHOT.jar base.Base
9-ea+113
FROM BASE -> NINE

Regards
Steve

Re: Multi-Release JAR runtime support

2016-04-19 Thread Paul Sandoz

> On 19 Apr 2016, at 14:11, Paul Sandoz  wrote:
> 
> 
>> On 19 Apr 2016, at 09:46, Alan Bateman > > wrote:
>> 
>> 
>> 
>> On 19/04/2016 02:49, Hervé BOUTEMY wrote:
>>> :
>>> 
>>> But the unexpected part is that JRE 9, either classical or jigsaw, don't 
>>> take
>>> advantage of the MR JAR: is this really expected, or did I do something 
>>> wrong?
>> Hervé - can you dump the manifest? It's not clear from your mail that it has 
>> the Multi-Release attribute.
>> 
> 
> Plus what build of JDK 9 are you using?
> 
> JDK 9 EA 114 has Mr.Jar integrated.
> 
>   https://jdk9.java.net/download/ 
> 

Sent too soon, i see you are using b114 already:

  9-ea+114-2016-04-15-162029.javare.4859.nc

Cab you check if you have:

  Multi-Release: true

in your manifest?

Paul.

> There are no current plans to back port the runtime parts to a Java 8 update 
> release.
> 
> Paul.



Re: Multi-Release JAR runtime support

2016-04-19 Thread Paul Sandoz

> On 19 Apr 2016, at 09:46, Alan Bateman  wrote:
> 
> 
> 
> On 19/04/2016 02:49, Hervé BOUTEMY wrote:
>> :
>> 
>> But the unexpected part is that JRE 9, either classical or jigsaw, don't take
>> advantage of the MR JAR: is this really expected, or did I do something 
>> wrong?
> Hervé - can you dump the manifest? It's not clear from your mail that it has 
> the Multi-Release attribute.
> 

Plus what build of JDK 9 are you using?

JDK 9 EA 114 has Mr.Jar integrated.

  https://jdk9.java.net/download/ 

There are no current plans to back port the runtime parts to a Java 8 update 
release.

Paul.


Re: Multi-Release JAR runtime support

2016-04-19 Thread Alan Bateman



On 19/04/2016 02:49, Hervé BOUTEMY wrote:

:

But the unexpected part is that JRE 9, either classical or jigsaw, don't take
advantage of the MR JAR: is this really expected, or did I do something wrong?
Hervé - can you dump the manifest? It's not clear from your mail that it 
has the Multi-Release attribute.


-Alan


Multi-Release JAR runtime support

2016-04-18 Thread Hervé BOUTEMY
Hi OpenJDK Core Developers,

Today, to prepare a conference talk on Java 9 (DevoxxFR, on wednesday 20th), I 
tested once again Maven proposed layout to produce Multi-Release JARs:
https://github.com/hboutemy/maven-jep238

And I added a little script (. run-demo.sh) to run the build then execute the 
resulting jar with JRE 7, 8 and 9.

As expected, JRE 7 and 8 gave the same result, since my JRE 8 isn't patched to 
support MR JARs (if there is a simple way to add support, don't hesitate to 
give me a pointer. Or if there is any standard Java 8 build that should 
support it).

But the unexpected part is that JRE 9, either classical or jigsaw, don't take 
advantage of the MR JAR: is this really expected, or did I do something wrong?

Regards,

Hervé

Here is the interesting part of the output of the script:

Archive:  multirelease/target/multirelease-0.8-SNAPSHOT.jar
testing: META-INF/MANIFEST.MF OK
testing: base/Base.class  OK
testing: mr/A.class   OK
testing: META-INF/versions/8/mr/A.class   OK
testing: META-INF/versions/9/mr/A.class   OK
No errors detected in compressed data of multirelease/target/multirelease-0.8-
SNAPSHOT.jar.
[...]
# Run Multi Release JAR with JRE 7
$ java -classpath multirelease/target/multirelease-0.8-SNAPSHOT.jar base.Base
1.7.0_71-b14
BASE

# Run Multi Release JAR with JRE 8
$ java -classpath multirelease/target/multirelease-0.8-SNAPSHOT.jar base.Base
1.8.0_25-b17
BASE

# Run Multi Release JAR with JRE 9 classic
$ java -classpath multirelease/target/multirelease-0.8-SNAPSHOT.jar base.Base
9-ea+114
BASE

# Run Multi Release JAR with JRE 9 Jigsaw
$ java -classpath multirelease/target/multirelease-0.8-SNAPSHOT.jar base.Base
9-ea+114-2016-04-15-162029.javare.4859.nc
BASE