JMC-6513: Wrong version of compiled classes when importing JMC maven projects in Eclipse with JDT Default Compiler Level of 11
Marcus Hirt
marcus.hirt at datadoghq.com
Mon Jul 1 08:33:23 UTC 2019
Sounds good! Can you open a new bug on investigating how to get maven
to be the single source of truth? I can push this.
Kind regards,
Marcus
On Mon, Jul 1, 2019 at 10:02 AM Langer, Christoph
<christoph.langer at sap.com> wrote:
>
> Hi Marcus,
>
> thanks for your comments. I agree - it would be ideal if everything was maintained via Maven and all Eclipse settings would be handled by this.
>
> Maybe, if I find time, I'll dig deeper in this. Especially why the behavior is so different between Mac and Windows.
>
> However, for the time being, I'd appreciate if this can be pushed.
>
> Cheers,
> Christoph
>
> > -----Original Message-----
> > From: Marcus Hirt <marcus.hirt at datadoghq.com>
> > Sent: Freitag, 28. Juni 2019 22:45
> > To: Langer, Christoph <christoph.langer at sap.com>; Guru
> > <guru.hb at oracle.com>
> > Cc: jmc-dev at openjdk.java.net
> > Subject: Re: JMC-6513: Wrong version of compiled classes when importing
> > JMC maven projects in Eclipse with JDT Default Compiler Level of 11
> >
> > Hi Christoph,
> >
> > I agree; I see no harm in taking this patch, though I would love to
> > see Maven and Eclipse collaborate better. In the best of all worlds,
> > no Eclipse project files would be required, Maven would be the one
> > source of truth and a simple Maven import would be all that is
> > required. Guru, do you have any strong opinion here?
> >
> > Kind regards,
> > Marcus
> >
> > On Fri, Jun 28, 2019 at 9:58 PM Langer, Christoph
> > <christoph.langer at sap.com> wrote:
> > >
> > > Ping: Any comments for this?
> > >
> > >
> > >
> > > From: Langer, Christoph
> > > Sent: Donnerstag, 20. Juni 2019 23:56
> > > To: jmc-dev at openjdk.java.net
> > > Subject: JMC-6513: Wrong version of compiled classes when importing JMC
> > maven projects in Eclipse with JDT Default Compiler Level of 11
> > >
> > >
> > >
> > > Hi,
> > >
> > >
> > >
> > > please let me know what you think of this patch:
> > >
> > >
> > >
> > > Bug: https://bugs.openjdk.java.net/browse/JMC-6513
> > >
> > > Webrev: http://cr.openjdk.java.net/~clanger/webrevs/JMC-6513.0/
> > >
> > >
> > >
> > > I'm having issues when importing the jmc projects into my Eclipse which
> > has a default JDK compiler level of 11. Although the JMC projects define a
> > JSE18 in their .classpath files, the classes get compiled with Java 11 version.
> > This can be helped by creating ".settings/org.eclipse.jdt.core.prefs" files
> > which set the compiler to 1.8. Then these issues were gone. So, in my patch I
> > propose to add them. A Java compiler level of 8 is needed in Eclipse because I
> > want to be able to run/debug with any JDK down to 8.
> > >
> > >
> > >
> > > Something is a bit weird though with maven import. On my Windows
> > Eclipse I observe that the import would generate these
> > .settings/org.eclipse.jdt.core.prefs as contained in the patch. However, this
> > import also regenerates some .classpath files which brings other issues and is
> > not what is wanted. On my Eclipse on Mac, I don't see neither
> > .settings/org.eclipse.jdt.core.prefs getting generated nor .classpath files
> > rewritten. Maven settings in both Eclipse installations seem to be the same.
> > Does anybody have an explanation for that?
> > >
> > >
> > >
> > > So, AFAICS, I don't think my patch causes any harm and can safely be used.
> > There's also precedence for that such as the projects in jmc/core (which
> > compile with JDK 1.7), as well as project
> > jmc/application/org.openjdk.jmc.osgi.extension which was introduced by
> > the patch for JMC-5859 [1].
> > >
> > >
> > >
> > > Thanks
> > >
> > > Christoph
> > >
> > >
> > >
> > > [1] http://hg.openjdk.java.net/jmc/jmc/rev/2cc768144a86
> > >
> > >
> > >
More information about the jmc-dev
mailing list