Log4j added support for Java 9 by: Converting the Log4j-API jar to a multi-release jar that includes support for StackWalker and the new Process Id support. Adding a module-info.jar to the Log4j API jar. We are now getting complaints from Android users (as well as a few others) that their tools no longer work with log4j. During development I ran into problems with OSGi. The problems seem to mostly revolve around the fact that they can’t deal with the classes for Java 9. I was surprised that Android is failing on the classes in META-INF/versions/9 as I had assumed that would be an invalid location for a class file prior to Java 9, but that seems not to be the case. The fact that module-info.java turns into a class file also seems to be a problem since the various tools are seeing it and having problems with it. We have been discussing various ways to handle this in https://issues.apache.org/jira/browse/LOG4J2-2133 <https://issues.apache.org/jira/browse/LOG4J2-2133>. There seems to be a strong push to just remove the support for Java 9 since it is breaking so many things. It seems impossible to have a module-info.java file in a jar that is going to be included in Android. If this had been a json file that was interpreted by the classloader or had a different file extension other than .class we wouldn’t be in this mess. We also need another mechanism to bring in our code that uses StackWalker as calling it via Reflection and emulating lambda expressions seems like it would be painful and slow. Do you have any recommendations on how we can resolve this impasse? Ralph
Ask Google to fix dx, dx should ignore the module-info.class and everything inside META-INF/versions (at least it's a first simple patch). cheers, Rémi ----- Mail original -----
De: "Ralph Goers" <ralph.goers@dslextreme.com> À: "core-libs-dev" <core-libs-dev@openjdk.java.net> Envoyé: Dimanche 3 Décembre 2017 19:25:08 Objet: Android and Log4j
Log4j added support for Java 9 by: Converting the Log4j-API jar to a multi-release jar that includes support for StackWalker and the new Process Id support. Adding a module-info.jar to the Log4j API jar.
We are now getting complaints from Android users (as well as a few others) that their tools no longer work with log4j. During development I ran into problems with OSGi. The problems seem to mostly revolve around the fact that they can’t deal with the classes for Java 9. I was surprised that Android is failing on the classes in META-INF/versions/9 as I had assumed that would be an invalid location for a class file prior to Java 9, but that seems not to be the case. The fact that module-info.java turns into a class file also seems to be a problem since the various tools are seeing it and having problems with it.
We have been discussing various ways to handle this in https://issues.apache.org/jira/browse/LOG4J2-2133 <https://issues.apache.org/jira/browse/LOG4J2-2133>. There seems to be a strong push to just remove the support for Java 9 since it is breaking so many things.
It seems impossible to have a module-info.java file in a jar that is going to be included in Android. If this had been a json file that was interpreted by the classloader or had a different file extension other than .class we wouldn’t be in this mess. We also need another mechanism to bring in our code that uses StackWalker as calling it via Reflection and emulating lambda expressions seems like it would be painful and slow.
Do you have any recommendations on how we can resolve this impasse?
Ralph
On Sun, Dec 3, 2017 at 11:02 AM, Remi Forax <forax@univ-mlv.fr> wrote:
Ask Google to fix dx, dx should ignore the module-info.class and everything inside META-INF/versions (at least it's a first simple patch).
Hi, I'm "Google", sort of. Friends tell me that dx is getting fixed.
Very latest Android Studio comes with two compilers, dx and d8. https://developer.android.com/studio/preview/features/index.html I hear that both compilers know to skip module-info files. On Mon, Dec 4, 2017 at 12:03 PM, Martin Buchholz <martinrb@google.com> wrote:
On Sun, Dec 3, 2017 at 11:02 AM, Remi Forax <forax@univ-mlv.fr> wrote:
Ask Google to fix dx, dx should ignore the module-info.class and everything inside META-INF/versions (at least it's a first simple patch).
Hi, I'm "Google", sort of. Friends tell me that dx is getting fixed.
De: "Martin Buchholz" <martinrb@google.com> À: "Remi Forax" <forax@univ-mlv.fr> Cc: "Ralph Goers" <ralph.goers@dslextreme.com>, "core-libs-dev" <core-libs-dev@openjdk.java.net> Envoyé: Mercredi 6 Décembre 2017 22:35:42 Objet: Re: Android and Log4j
Very latest Android Studio comes with two compilers, dx and d8. [ https://developer.android.com/studio/preview/features/index.html | https://developer.android.com/studio/preview/features/index.html ] I hear that both compilers know to skip module-info files.
I hope dx will die soon, i had to patch it once and i was messy, a register allocator is usually not a fun code but in case of dx, it is hidden by several layers of abstraction which made me cringe. Rémi
On Mon, Dec 4, 2017 at 12:03 PM, Martin Buchholz < [ mailto:martinrb@google.com | martinrb@google.com ] > wrote:
On Sun, Dec 3, 2017 at 11:02 AM, Remi Forax < [ mailto:forax@univ-mlv.fr | forax@univ-mlv.fr ] > wrote:
Ask Google to fix dx, dx should ignore the module-info.class and everything inside META-INF/versions (at least it's a first simple patch).
Hi, I'm "Google", sort of. Friends tell me that dx is getting fixed.
I can neither confirm nor deny that dx is going to die, but it sure looks like "Google" is replacing it with "D8". https://android-developers.googleblog.com/2017/08/next-generation-dex-compil... On Wed, Dec 6, 2017 at 2:03 PM, <forax@univ-mlv.fr> wrote:
------------------------------
*De: *"Martin Buchholz" <martinrb@google.com> *À: *"Remi Forax" <forax@univ-mlv.fr> *Cc: *"Ralph Goers" <ralph.goers@dslextreme.com>, "core-libs-dev" < core-libs-dev@openjdk.java.net> *Envoyé: *Mercredi 6 Décembre 2017 22:35:42 *Objet: *Re: Android and Log4j
Very latest Android Studio comes with two compilers, dx and d8. https://developer.android.com/studio/preview/features/index.html I hear that both compilers know to skip module-info files.
I hope dx will die soon, i had to patch it once and i was messy, a register allocator is usually not a fun code but in case of dx, it is hidden by several layers of abstraction which made me cringe.
Rémi
On Mon, Dec 4, 2017 at 12:03 PM, Martin Buchholz <martinrb@google.com> wrote:
On Sun, Dec 3, 2017 at 11:02 AM, Remi Forax <forax@univ-mlv.fr> wrote:
Ask Google to fix dx, dx should ignore the module-info.class and everything inside META-INF/versions (at least it's a first simple patch).
Hi, I'm "Google", sort of. Friends tell me that dx is getting fixed.
Martin, Do they also ignore the class files in META-INF/versions? Ralph
On Dec 6, 2017, at 2:35 PM, Martin Buchholz <martinrb@google.com> wrote:
Very latest Android Studio comes with two compilers, dx and d8. https://developer.android.com/studio/preview/features/index.html <https://developer.android.com/studio/preview/features/index.html> I hear that both compilers know to skip module-info files.
On Mon, Dec 4, 2017 at 12:03 PM, Martin Buchholz <martinrb@google.com <mailto:martinrb@google.com>> wrote:
On Sun, Dec 3, 2017 at 11:02 AM, Remi Forax <forax@univ-mlv.fr <mailto:forax@univ-mlv.fr>> wrote: Ask Google to fix dx, dx should ignore the module-info.class and everything inside META-INF/versions (at least it's a first simple patch).
Hi, I'm "Google", sort of. Friends tell me that dx is getting fixed.
Martin, I don’t think I got a reply to this question. I created https://issuetracker.google.com/issues/70118537 <https://issuetracker.google.com/issues/70118537> for this but I have not gotten any response. Is there a better mailing list where I should follow up? Ralph
On Dec 6, 2017, at 10:25 PM, Ralph Goers <ralph.goers@dslextreme.com> wrote:
Martin,
Do they also ignore the class files in META-INF/versions?
Ralph
On Dec 6, 2017, at 2:35 PM, Martin Buchholz <martinrb@google.com> wrote:
Very latest Android Studio comes with two compilers, dx and d8. https://developer.android.com/studio/preview/features/index.html <https://developer.android.com/studio/preview/features/index.html> I hear that both compilers know to skip module-info files.
On Mon, Dec 4, 2017 at 12:03 PM, Martin Buchholz <martinrb@google.com <mailto:martinrb@google.com>> wrote:
On Sun, Dec 3, 2017 at 11:02 AM, Remi Forax <forax@univ-mlv.fr <mailto:forax@univ-mlv.fr>> wrote: Ask Google to fix dx, dx should ignore the module-info.class and everything inside META-INF/versions (at least it's a first simple patch).
Hi, I'm "Google", sort of. Friends tell me that dx is getting fixed.
On Tue, Jan 9, 2018 at 5:11 PM, Ralph Goers <ralph.goers@dslextreme.com> wrote:
I don’t think I got a reply to this question. I created https://issuetracker.google.com/issues/70118537 for this but I have not gotten any response. Is there a better mailing list where I should follow up?
Sorry Ralph, I don't know.
Hi Google :) great news. Rémi
De: "Martin Buchholz" <martinrb@google.com> À: "Remi Forax" <forax@univ-mlv.fr> Cc: "Ralph Goers" <ralph.goers@dslextreme.com>, "core-libs-dev" <core-libs-dev@openjdk.java.net> Envoyé: Lundi 4 Décembre 2017 21:03:23 Objet: Re: Android and Log4j
On Sun, Dec 3, 2017 at 11:02 AM, Remi Forax < [ mailto:forax@univ-mlv.fr | forax@univ-mlv.fr ] > wrote:
Ask Google to fix dx, dx should ignore the module-info.class and everything inside META-INF/versions (at least it's a first simple patch).
Hi, I'm "Google", sort of. Friends tell me that dx is getting fixed.
On 03/12/2017 18:25, Ralph Goers wrote:
Log4j added support for Java 9 by: Converting the Log4j-API jar to a multi-release jar that includes support for StackWalker and the new Process Id support. Adding a module-info.jar to the Log4j API jar.
We are now getting complaints from Android users (as well as a few others) that their tools no longer work with log4j. During development I ran into problems with OSGi. The problems seem to mostly revolve around the fact that they can’t deal with the classes for Java 9. I was surprised that Android is failing on the classes in META-INF/versions/9 as I had assumed that would be an invalid location for a class file prior to Java 9, but that seems not to be the case. The fact that module-info.java turns into a class file also seems to be a problem since the various tools are seeing it and having problems with it.
:
Do you have any recommendations on how we can resolve this impasse?
The Android tools should ignore class files in META/**, at least until they are updated to work with multi-release JARs. Have you created a bug for them to look at this issue? -Alan
Hi, I'd also suggest to place the module-info.class inside the versions folder. So it should be ignored once the meta-inf bug is fixed. Java 9 should also read the module info from the versioned folder. Uwe Am 3. Dezember 2017 20:19:34 MEZ schrieb Alan Bateman <Alan.Bateman@oracle.com>:
On 03/12/2017 18:25, Ralph Goers wrote:
Log4j added support for Java 9 by: Converting the Log4j-API jar to a multi-release jar that includes support for StackWalker and the new Process Id support. Adding a module-info.jar to the Log4j API jar.
We are now getting complaints from Android users (as well as a few others) that their tools no longer work with log4j. During development I ran into problems with OSGi. The problems seem to mostly revolve around the fact that they can’t deal with the classes for Java 9. I was surprised that Android is failing on the classes in META-INF/versions/9 as I had assumed that would be an invalid location for a class file prior to Java 9, but that seems not to be the case. The fact that module-info.java turns into a class file also seems to be a problem since the various tools are seeing it and having problems with it.
:
Do you have any recommendations on how we can resolve this impasse?
The Android tools should ignore class files in META/**, at least until they are updated to work with multi-release JARs. Have you created a bug for them to look at this issue?
-Alan
-- Uwe Schindler Achterdiek 19, 28357 Bremen https://www.thetaphi.de
On Dec 3, 2017, at 12:19 PM, Alan Bateman <Alan.Bateman@oracle.com> wrote:
On 03/12/2017 18:25, Ralph Goers wrote:
Log4j added support for Java 9 by: Converting the Log4j-API jar to a multi-release jar that includes support for StackWalker and the new Process Id support. Adding a module-info.jar to the Log4j API jar.
We are now getting complaints from Android users (as well as a few others) that their tools no longer work with log4j. During development I ran into problems with OSGi. The problems seem to mostly revolve around the fact that they can’t deal with the classes for Java 9. I was surprised that Android is failing on the classes in META-INF/versions/9 as I had assumed that would be an invalid location for a class file prior to Java 9, but that seems not to be the case. The fact that module-info.java turns into a class file also seems to be a problem since the various tools are seeing it and having problems with it.
:
Do you have any recommendations on how we can resolve this impasse?
The Android tools should ignore class files in META/**, at least until they are updated to work with multi-release JARs. Have you created a bug for them to look at this issue?
Yes, although I don’t develop for Android so I am not certain I created the issue correctly. https://issuetracker.google.com/u/1/issues/70118537 <https://issuetracker.google.com/u/1/issues/70118537>. I also created https://issues.apache.org/jira/browse/FELIX-5592 <https://issues.apache.org/jira/browse/FELIX-5592> which relates to https://issues.apache.org/jira/browse/FELIX-5527 <https://issues.apache.org/jira/browse/FELIX-5527>. No activity has occurred on either of these issues. Ralph
participants (6)
-
Alan Bateman
-
forax@univ-mlv.fr
-
Martin Buchholz
-
Ralph Goers
-
Remi Forax
-
Uwe Schindler