Re: javac bootclasspath and java8

2014-12-01 Thread Mark Derricutt
On 1 Dec 2014, at 22:23, Mark Struberg wrote: > 2.) enhance the ToolchainManager to let lookup configured Toolchains and use > this in maven-compiler-plugin and maven-test-plugin to use a 'preferred' > Toolchain version. E.g. if target=1.7 is defined it should try to resolve > this Toolchain.

Re: javac bootclasspath and java8

2014-12-01 Thread Robert Scholte
Op Mon, 01 Dec 2014 10:23:09 +0100 schreef Mark Struberg : The issue is that there are classes which generate a different signature when compiled with the Java 8 RT vs when compiled with the Java 7 RT. +1 I think what we - as a community - are learning is that we no longer have the

Re: javac bootclasspath and java8

2014-12-01 Thread Igor Fedorenko
I think selected JDK should also be used to resolve ${java.home} in system-scoped dependencies. Which I think means concept of project "target" JDK should be directly supported by Maven itself. -- Regards, Igor On 2014-12-01, 4:23, Mark Struberg wrote: The issue is that there are classes which

Re: javac bootclasspath and java8

2014-12-01 Thread Mark Struberg
Hi Paul! Txs, this is definitely one possible direction in which we could aim. LieGrue, strub > On Saturday, 29 November 2014, 11:18, Paul Moloney > wrote: > > Hi > > I had written this rule for the enforcer plugin which actually checks the > label of jdk version in toolchains against out

Re: javac bootclasspath and java8

2014-12-01 Thread Stephen Connolly
On 1 December 2014 at 09:23, Mark Struberg wrote: > > The issue is that there are classes which generate a different signature > > > when compiled with the Java 8 RT vs when compiled with the Java 7 RT. > > > +1 > > > > I think what we - as a community - are learning is that we no longer > > > ha

Re: javac bootclasspath and java8

2014-12-01 Thread Mark Struberg
> The issue is that there are classes which generate a different signature > when compiled with the Java 8 RT vs when compiled with the Java 7 RT. +1 > I think what we - as a community - are learning is that we no longer > have the luxury of compiling with a newer JDK against an older targe

Re: javac bootclasspath and java8

2014-11-30 Thread Stephen Connolly
Jochen, I think you misunderstand the problem. The issue is that there are classes which generate a different signature when compiled with the Java 8 RT vs when compiled with the Java 7 RT. For example, you could have a method that takes a String parameter in Java 7 and was widened to take a Cha

Re: javac bootclasspath and java8

2014-11-30 Thread Jochen Wiedmann
I'd solve your problem like this, Mark: - Create an interface for a component, which is internally using the JDK code in question, (say IRTUser). - Create three implementations, each of which are targeting a particular JDK. In what follows, I'll assume that they throw an exception when being insta

Re: javac bootclasspath and java8

2014-11-29 Thread Paul Moloney
Hi I had written this rule for the enforcer plugin which actually checks the label of jdk version in toolchains against output of javc --version. It works for my limited scenario @work and definetely requires more attention to cope with non oracle compilers and the apache way. https://github.com/

Re: javac bootclasspath and java8

2014-11-28 Thread Mark Struberg
Hi! > This lets you selectively forbid certain methods The problem is that the methods used are perfectly fine. The API methods used in our program do exist even in Java6. But they get coerced to different methods when compiling with Java8. And those new methods do not exist in Java7 and ol

Re: javac bootclasspath and java8

2014-11-27 Thread Dawid Weiss
There is also a very cool tool from the Lucene land, written by Uwe Schindler -- https://code.google.com/p/forbidden-apis/ This lets you selectively forbid certain methods from your codebase (and the default list of forbidden methods has a strong rationale to be discouraged -- locale-sensitive me

Re: javac bootclasspath and java8

2014-11-27 Thread Stephen Connolly
On Thursday, 27 November 2014, Mark Derricutt wrote: > On 28 Nov 2014, at 10:32, Igor Fedorenko wrote: > > > Out of curiosity, why do you want to get exactly the same bytecode? Does > > the code compiled with java8 not work under java7? > > Mostly - it's due to method signature resolution. For i

Re: javac bootclasspath and java8

2014-11-27 Thread Mark Derricutt
On 28 Nov 2014, at 10:32, Igor Fedorenko wrote: > Out of curiosity, why do you want to get exactly the same bytecode? Does > the code compiled with java8 not work under java7? Mostly - it's due to method signature resolution. For instance in the JDK 5 -> 6 change, some functions that used to ta

Re: javac bootclasspath and java8

2014-11-27 Thread Raphael Ackermann
It won't always work. Read a blog post detailing the problem once but can't find it right now. Looking at http://www.oracle.com/technetwork/java/javase/8-compatibility-guide-2156366.html#A999198 there's a list of behavioural changes On Thu, Nov 27, 2014, 22:33 Igor Fedorenko wrote: > Out of curi

Re: javac bootclasspath and java8

2014-11-27 Thread Igor Fedorenko
Out of curiosity, why do you want to get exactly the same bytecode? Does the code compiled with java8 not work under java7? -- Regards, Igor On 2014-11-27, 15:39, Mark Struberg wrote: Hi! Today I had a discussion with Robert about how we can solve a problem I had over at Apache OpenWebBeans:

javac bootclasspath and java8

2014-11-27 Thread Mark Struberg
Hi! Today I had a discussion with Robert about how we can solve a problem I had over at Apache OpenWebBeans: https://issues.apache.org/jira/browse/OWB-952 As a short summary: the classes provided in rt.jar of Java8 are slightly different than the ones from Java7 and 6. Similar big differences