[wildfly-dev] Java 8 API Warning

David M. Lloyd david.lloyd at redhat.com
Fri Apr 17 09:12:49 EDT 2015


The good news is, there's talk that with Java 9, the JDK will include 
(in some form) APIs for previous versions, so that if you want to target 
an earlier version, you can link against its runtime as well.

On 04/17/2015 08:11 AM, Steve Ebersole wrote:
> I ran into issues with using Java 8 to run my build but targeting Java 7
> for most artifacts.  I would highly suggest applying a solution based on
> AnimalSniffer or supplying the Java 6/7 tools.jar for bootclasspath to
> javac.  Helps catch these types of issues
>
> On Apr 17, 2015 8:04 AM, "Darran Lofthouse" <darran.lofthouse at jboss.com
> <mailto:darran.lofthouse at jboss.com>> wrote:
>
>     Quick warning for anyone developing using Java 8 but on projects still
>     dependent on Java 7.
>
>     Normally this is fine, as an engineer you make sure you don't use any
>     new language features or call new APIs and generally it all works.
>
>     With Java 8 there is one addition gotcha, Java 8 adds support for
>     default method implementations on interfaces, to add to this some
>     pre-existing methods have now been replaced with default
>     implementations.  The side effect being it is easy to miss that you have
>     a method missing from a class and it will not be picked up till it is
>     compiled on Java 7.
>
>     e.g. On java.util.Iterator the remove method is now default so classes
>     that implement this interface no longer need to implement that method
>     unless they really are providing an implementation of that method.
>
>     Regards,
>     Darran Lofthouse.
>
>     _______________________________________________
>     wildfly-dev mailing list
>     wildfly-dev at lists.jboss.org <mailto:wildfly-dev at lists.jboss.org>
>     https://lists.jboss.org/mailman/listinfo/wildfly-dev
>
>
>
> _______________________________________________
> wildfly-dev mailing list
> wildfly-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>

-- 
- DML


More information about the wildfly-dev mailing list