Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Java 11 est sorti, c'est le moment de remplacer son JDK 8

Java 11 est sorti, c'est le moment de remplacer son JDK 8

Pourquoi parler de Java 11 alors que Java 12 sort la semaine prochaine ?

C'est parce que Java 11 est une version LTS (Long Term Support), c'est à dire une version de Java avec un support étendu. Après la sortie de Java 9, 10, c'est le moment de franchir le cap et de changer de JDK. Nous verrons les nouveautés, les points d'attention. En clair, tout ce que vous devez savoir pour migrer en Java 11 en douceur et profitez des nouvelles fonctionnalités

Lilian BENOIT

March 14, 2019
Tweet

More Decks by Lilian BENOIT

Other Decks in Technology

Transcript

  1. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 1/89 JAVA 11 EST SORTI, C'EST LE MOMENT DE JAVA 11 EST SORTI, C'EST LE MOMENT DE REMPLACER SON JDK 8 REMPLACER SON JDK 8 par Lilian BENOIT | (MARS 2019) (MARS 2019) @Lilian_Benoit http://github.com/lilian-benoit MARSEILLE JUG MARSEILLE JUG
  2. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 2/89 JDK 8 EST SORTI EN 2014 JDK 8 EST SORTI EN 2014 SOIT 5 ANS DÉJÀ SOIT 5 ANS DÉJÀ POUR INFORMATION, 1ER VERSION DU JDK EN 1996 POUR INFORMATION, 1ER VERSION DU JDK EN 1996
  3. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 3/89 LA DONNE A CHANGÉ. LA DONNE A CHANGÉ.
  4. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 4/89 LA DONNE A CHANGÉ. LA DONNE A CHANGÉ. Java 9 avec le Projet Jigsaw Changement de licence Nouveau calendrier de sortie
  5. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 5/89 NOUVEAU CALENDRIER NOUVEAU CALENDRIER DE SORTIE DE SORTIE
  6. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 6/89 PRÉCÉDENTES DATES DE SORTIE DE JAVA. PRÉCÉDENTES DATES DE SORTIE DE JAVA. JDK 1.0 / 23 Janvier 1996 ... J2SE 5 / 30 Septembre 2004 Java SE 6 / 11 Décembre 2006 Java SE 7 / 28 Juillet 2011 Java SE 8 / 18 Mars 2014
  7. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 7/89 NOUVELLE CADENCE DE SORTIE. NOUVELLE CADENCE DE SORTIE. Java SE 9 / 21 Septembre 2017 Java SE 10 / 20 Mars 2018 Java SE 11 / 25 Septembre 2018 Java SE 12 / 19 Mars 2019
  8. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 8/89 VERSIONS LTS. VERSIONS LTS. Java SE 8 / 18 Mars 2014 Java SE 11 / 25 Septembre 2018
  9. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 9/89 “You can choose the conservative LTS path (blue pill)... or you can choose the aggressive feature release path (red pill)” @mreinhold #FOSDEM”
  10. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 10/89 CHANGEMENT DE CHANGEMENT DE LICENCE LICENCE
  11. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 11/89 ORACLE FOURNIT JDK SOUS 2 FORMES ORACLE FOURNIT JDK SOUS 2 FORMES Oracle JDK Oracle OpenJDK
  12. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 12/89
  13. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 13/89 JAVA N'EST PLUS JAVA N'EST PLUS GRATUIT ? GRATUIT ?
  14. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 14/89 SI, MAIS LE JDK D'ORACLE N'EST PLUS LE JDK PAR DÉFAUT SI, MAIS LE JDK D'ORACLE N'EST PLUS LE JDK PAR DÉFAUT LE JDK EST DÉVELOPPÉ AVEC OPENJDK À LA BASE LE JDK EST DÉVELOPPÉ AVEC OPENJDK À LA BASE
  15. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 15/89 DÉTERMINATION DE L'ORIGINE DÉTERMINATION DE L'ORIGINE ORACLE JDK ORACLE JDK OPENJDK OPENJDK java -version java 11 2018-09-25 Java(TM) SE Runtime Environment 18.9 (build 11+28) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11+28, mixed mode) java 11 2018-09-25 OpenJDK Runtime Environment 18.9 (build 11+28) OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
  16. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 16/89 QUE FAIRE RESTER EN JDK 8? QUE FAIRE RESTER EN JDK 8? Ne pas tenir compte de la sécurité Sous *nix, utiliser les versions fournies par les distributions Payer le support Construire son propre JDK Utiliser les binaires de AdoptOpenJDK
  17. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 17/89 QUE FAIRE RESTER EN JDK 9 OU JDK 10? QUE FAIRE RESTER EN JDK 9 OU JDK 10? Personne ne fournit de support sur ces versions
  18. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 18/89 PASSER AU JDK 11, RESTE À CHOISIR SON FOURNISSEUR DE JDK PASSER AU JDK 11, RESTE À CHOISIR SON FOURNISSEUR DE JDK Oracle JDK AdoptOpenJDK Redhat Distribution linux (debian, arch...) Azul Zulu Amazon Corretto IBM basé sur OpenJ9 SAP Liberica
  19. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 19/89 Version Date de sortie Fin support Oracle Fin support OpenJDK Java 8 Mars 2014 Janv. 2019 Juin 2023 Java 9 Sept. 2017 Mars 2018 N/A Java 10 Mars 2018 Sept. 2018 N/A Java 11 Sept. 2018 Mars 2019 Sep. 2022 Java 12 Mars 2019 Sept. 2019 N/A
  20. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 20/89 PROJET JIGSAW PROJET JIGSAW JAVA 9 JAVA 9
  21. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 21/89 PROJET JIGSAW PROJET JIGSAW JEP 200 - The Modular JDK JEP 201 - Modular Source code JEP 220 - Modular Runtime Images JEP 260 - Encapsulate Most Internal APIs JEP 261 - Module System
  22. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 22/89
  23. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 23/89 JAVA 9 JAVA 9 (ET +) (ET +) LE CLASSPATH N'EST LE CLASSPATH N'EST PAS MORT PAS MORT
  24. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 24/89 PASSONS EN REVUE LES PASSONS EN REVUE LES NOUVEAUTÉS NOUVEAUTÉS
  25. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 25/89 JAVA 9 JAVA 9 91 JEP (JDK ENHANCEMENT PROPOSALS) 91 JEP (JDK ENHANCEMENT PROPOSALS)
  26. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 26/89 NOUVEAUTÉ JAVA 9 NOUVEAUTÉ JAVA 9 JSR 376 - Projet Jigsaw JEP 110 - Client HTTP/2 (incubation) JEP 222 - JShell: the interactive Java REPL JEP 224, 225 - Javadoc (HTML5 et Recherche) JEP 269 - Collection factory methods JEP 277 - Enhanced Deprecation JEP 282 - jlink, Editeur de liens Java JEP 295 - Ahead-of-Time Compilation (Expérimental)
  27. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 27/89 JSR 376 - PROJET JIGSAW JSR 376 - PROJET JIGSAW
  28. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 28/89 JEP 110 - CLIENT HTTP/2 (INCUBATION) JEP 110 - CLIENT HTTP/2 (INCUBATION)
  29. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 29/89 JEP 222 - JSHELL: THE INTERACTIVE JAVA REPL JEP 222 - JSHELL: THE INTERACTIVE JAVA REPL
  30. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 30/89 JEP 224, 225 - JAVADOC (HTML5 ET RECHERCHE) JEP 224, 225 - JAVADOC (HTML5 ET RECHERCHE) Ouvrir la javadoc 9 ( ou ) Ouvrir la javadoc 11 ( ou ) localhost en ligne localhost en ligne
  31. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 31/89 JEP 269 - COLLECTION FACTORY METHODS JEP 269 - COLLECTION FACTORY METHODS Avant Après List<String> liste = new ArrayList<String>(); liste.add("J'"); liste.add("Adore"); liste.add("Marseille"); liste = Collections.unmodifiableList(liste); List<String> liste = List.of("J'","Adore","Marseille");
  32. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 32/89 JEP 277 - ENHANCED DEPRECATION JEP 277 - ENHANCED DEPRECATION
  33. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 33/89
  34. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 34/89 JEP 277 - ENHANCED DEPRECATION JEP 277 - ENHANCED DEPRECATION since forRemoval
  35. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 35/89 JEP 282 - JLINK, EDITEUR DE LIENS JAVA JEP 282 - JLINK, EDITEUR DE LIENS JAVA
  36. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 36/89 JEP 295 - AHEAD-OF-TIME COMPILATION JEP 295 - AHEAD-OF-TIME COMPILATION Expérimental Utiliser par GraalVM
  37. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 37/89 JAVA 10 JAVA 10
  38. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 38/89 NOUVEAUTÉ JAVA 10 NOUVEAUTÉ JAVA 10 JEP 286 - Local-Variable Type Inference JEP 304 - Garbage Collector Interface JEP 307 - Parallel Full GC for G1 JEP 319 - Root Certi cates JEP 322 - Time-based Release Versionning
  39. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 39/89 JEP 286 - LOCAL-VARIABLE TYPE INFERENCE JEP 286 - LOCAL-VARIABLE TYPE INFERENCE
  40. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 40/89 JEP 304 - GARBAGE COLLECTOR INTERFACE JEP 304 - GARBAGE COLLECTOR INTERFACE
  41. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 41/89 JEP 307 - PARALLEL FULL GC FOR G1 JEP 307 - PARALLEL FULL GC FOR G1
  42. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 42/89 JEP 319 - ROOT CERTIFICATES JEP 319 - ROOT CERTIFICATES
  43. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 43/89 JEP 322 - TIME-BASED RELEASE VERSIONNING JEP 322 - TIME-BASED RELEASE VERSIONNING
  44. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 44/89 JAVA 11 JAVA 11
  45. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 45/89 NOUVEAUTÉ JAVA 11 NOUVEAUTÉ JAVA 11 JEP 321 - HTTP Client (Standard) JEP 328 - Java Flight Recorder (JFR) JEP 330 - Launch Single-File Source-Code Programs JEP 332 - Transport Layer Security (TLS) 1.3 JEP 333 - Project ZGC
  46. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 46/89 JEP 321 - HTTP CLIENT (STANDARD) JEP 321 - HTTP CLIENT (STANDARD) Avant Après URL url = new URL("http://wwww...."); InputStream is = url.openStream() HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .GET() .uri(new URI("http://wwww....")) .build(); var response = client.send(request, BodyHandlers.ofString());
  47. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 47/89 JEP 328 - JAVA FLIGHT RECORDER (JFR) JEP 328 - JAVA FLIGHT RECORDER (JFR)
  48. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 48/89 JEP 330 - LAUNCH SINGLE-FILE SOURCE-CODE PROGRAMS JEP 330 - LAUNCH SINGLE-FILE SOURCE-CODE PROGRAMS
  49. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 49/89 JEP 332 - TRANSPORT LAYER SECURITY (TLS) 1.3 JEP 332 - TRANSPORT LAYER SECURITY (TLS) 1.3 Annonce IETF, 10 août 2018 https://www.ietf.org/blog/tls13/
  50. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 50/89 JEP 333 - PROJECT ZGC (EXPÉRIMENTAL) JEP 333 - PROJECT ZGC (EXPÉRIMENTAL) Support Linux/x64 (initialement)
  51. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 51/89 MAIS UNE NOUVELLE VERSION AMÈNE... MAIS UNE NOUVELLE VERSION AMÈNE...
  52. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 52/89 SUPPRESSION DES MODULES JAVAFX SUPPRESSION DES MODULES JAVAFX
  53. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 53/89
  54. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 54/89 SUPPRESSION DES MODULES DE DÉPLOIEMENT SUPPRESSION DES MODULES DE DÉPLOIEMENT Applet Java Web Start (JWS)
  55. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 55/89 MODULES JAVA EE SUPPRIMÉS MODULES JAVA EE SUPPRIMÉS
  56. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 56/89
  57. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 57/89 MODULES JAVA EE SUPPRIMÉS MODULES JAVA EE SUPPRIMÉS JavaBeans Activation Framework (JAF) CORBA Java Transaction API (JTA) javax.activation javax.activity.* javax.rmi.* javax.rmi.CORBA.* org.omg.* javax.transaction.*
  58. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 58/89 MODULES JAVA EE SUPPRIMÉS MODULES JAVA EE SUPPRIMÉS Java Architecture for XML Binding (JAXB) Java API for XML Web Services (JAX-WS) Commons annotations javax.xml.bind.* javax.jws.* javax.jws.soap.* javax.xml.soap.* javax.xms.ws.* javax.annotation.*
  59. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 59/89 TAILLE DU JDK TAILLE DU JDK Versions JDK Taille (Mo) 1.5 u22 113 Mo 1.6 u45 206 Mo 1.7 u71 288 Mo 1.8 u72 356 Mo 1.8 u131 364 Mo 9 545 Mo 10 736 Mo 11 309 Mo
  60. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 60/89 PRÉPARATION À LA PRÉPARATION À LA MIGRATION MIGRATION
  61. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 61/89 PRÉPARATION À LA MIGRATION PRÉPARATION À LA MIGRATION Branche spéci que mais courte S'appuyer sur l'intégration continue S'appuyer sur l'outil de construction pour le spéci que Garder une con guration spéci que minimaliste
  62. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 62/89 BRANCHE SPÉCIFIQUE MAIS COURTE BRANCHE SPÉCIFIQUE MAIS COURTE
  63. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 63/89 S'APPUYER SUR L'INTÉGRATION CONTINUE S'APPUYER SUR L'INTÉGRATION CONTINUE
  64. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 64/89 S'APPUYER SUR L'OUTIL DE CONSTRUCTION S'APPUYER SUR L'OUTIL DE CONSTRUCTION <profiles> <profile> <id>java-11</id> <activation> <jdk>11</jdk> </activation> <!-- Configuration spécifique Java 11 --> </profile> </profiles>
  65. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 65/89 GARDER UNE CONFIGURATION SPÉCIFIQUE MINIMALISTE GARDER UNE CONFIGURATION SPÉCIFIQUE MINIMALISTE
  66. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 66/89 PRÊT... ? PRÊT... ?
  67. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 67/89 METTRE À JOUR LES METTRE À JOUR LES OUTILS OUTILS
  68. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 68/89 SON ENVIRONNEMENT DE DÉVELOPPEMENT SON ENVIRONNEMENT DE DÉVELOPPEMENT Eclipse 4.9 (Photon) RC2 avec Plugin Java 11 Intellij IDEA 2018.2 Netbeans 9.0
  69. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 69/89 OUTIL DE CONSTRUCTION OUTIL DE CONSTRUCTION Gradle 5.0 Maven 3.5.0 compiler plugin : 3.8.0 sure re et failsafe : 2.22.0
  70. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 70/89 PASSONS AU PROJET... PASSONS AU PROJET...
  71. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 71/89 LES LIBRAIRIES LES LIBRAIRIES Véri er les dépendances (compatible java 11) Surveiller les librairies de manipulation de bytecode
  72. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 72/89 PRINCIPALES LIBRAIRIES PRINCIPALES LIBRAIRIES Nom Version Lombok 1.18.4 ASM 7.0 Byte Buddy 1.9.0 cglib 3.2.8 javassist 3.23.1-GA
  73. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 73/89 ILLUSTRATION AVEC MAVEN ILLUSTRATION AVEC MAVEN <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.7.0</version> <dependencies> <dependency> <!-- Utilisation de la version ASM compatible 11 --> <groupId>org.ow2.asm</groupId> <artifactId>asm</artifactId> <version>7.0</version> </dependency> </dependencies> </plugin>
  74. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 74/89 ILLUSTRATION AVEC HIBERNATE ILLUSTRATION AVEC HIBERNATE <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>5.2.12.Final</version> </dependency> <dependency> <!-- Utilisation de la version javassist compatible 11 --> <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> <version>3.23.1-GA</version> </dependency>
  75. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 75/89 LIBRAIRIES NON COMPATIBLES LIBRAIRIES NON COMPATIBLES JaCoCo (à la place de Cobertura) Log4j 2 (à la place de Log4j v1.x) et d'autres.....
  76. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 76/89 QUE FAIT-ON AVEC LES ANCIENS MODULES JAVAEE ? QUE FAIT-ON AVEC LES ANCIENS MODULES JAVAEE ?
  77. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 77/89 SYMPTOMES SYMPTOMES error: package javax.xml.bind.annotation does not exist error: cannot find symbol [ERROR] symbol: class XmlRootElement
  78. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 78/89 Nom Modules JAF com.sun.activation:javax.activation JTA javax.transaction:javax.transaction- api JAXB com.sun.xml.bind:jaxb-impl org.glass sh.jaxb:jaxb-runtime JAX-WS com.sun.xml.ws:javaws-ri Commons annotation javax.annotation:javax.annotation- api CORBA Pas de correspondance
  79. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 79/89 UTILISATION D'ANCIENNES CLASSES UTILISATION D'ANCIENNES CLASSES sun.misc.Base64 (remplacé par java.util.Base64) Méthodes peuvent être supprimées (add/removePropertyChangeListener) et d'autres.....
  80. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 80/89 SOURCES D'INFORMATIONS SOURCES D'INFORMATIONS Readme JDK 9 Readme JDK 10 Readme JDK 11
  81. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 81/89 PROBLÈME CONNU : URL CLASSLOADER PROBLÈME CONNU : URL CLASSLOADER Java 9 apporte un nouveau classloader Plus d'héritage avec URL Classloader
  82. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 82/89 SYMPTOMES SYMPTOMES Exception in thread "main" java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader
  83. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 83/89 SOLUTIONS SOLUTIONS Propriété java.class.path Utiliser les nouvelles classes (JDK 9 et + seulement) System.getProperty("java.class.path")
  84. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 84/89 PROBLÈME CONNU : ILLEGAL ACCESS TO INTERNAL APIS PROBLÈME CONNU : ILLEGAL ACCESS TO INTERNAL APIS Encapsulation forte introduite en Java 9
  85. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 85/89 SOLUTIONS SOLUTIONS --illegal-access --add-exports --add-opens (setAccessible(true)
  86. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 86/89 OUTILS POUR VOUS AIDER OUTILS POUR VOUS AIDER jdeps plugin maven-jdeps
  87. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 87/89 CONCLUSION CONCLUSION
  88. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 88/89 CONCLUSION CONCLUSION OpenJDK par défaut Choisir son calendrier Classpath n'est pas mort Pro ter des nouveautés Remplacer les modules supprimés
  89. 19/03/2019 Java 11 est sorti, c'est le moment de remplacer

    son JDK 8 http://localhost/presentation/2019-jdk11/?print-pdf 89/89 QUESTIONS ? QUESTIONS ?