Presentation is loading. Please wait.

Presentation is loading. Please wait.

Embracing Java 9 and beyond with Eclipse JDT

Similar presentations


Presentation on theme: "Embracing Java 9 and beyond with Eclipse JDT"— Presentation transcript:

1 Embracing Java 9 and beyond with Eclipse JDT
Sarika Sinha Committer Platform and JDT Eclipse Projects, Co-Lead Eclipse JDT Project

2 Agenda Java and Eclipse release timelines Java 9 features
Moving from Java 8 to Java 9 and beyond

3 Java and Eclipse release timelines
Twice yearly releases of Java from 2018 in March and September Quarterly releases of Eclipse in March, June, September and December.

4 Java 9 features Private interface methods
Try-With Resources enhancements @SafeVarargs Annotation for private instance methods Collection Factory Methods Stream improvements Option --release Modules Launching with Java 9 and beyond Overriding dependencies while launching for Java 9 and beyond

5 Java 9 features - Private interface methods
Java 9 allows private methods and private static methods in interfaces.

6 Java 9 features - Try-With Resources enhancements
Final and effectively final variables can be placed in try-with- resource blocks, starting in Java 9.

7 Java 9 features - @SafeVarargs enhancement
Java 9 annotation for private instance methods also.

8 Java 9 features – Collection factory methods
Java 9 has added simple ways to create immutable Collections without null values.

9 Java 9 features - Stream improvements
Stream takeWhile/dropWhile Stream iterate Stream ofNullable

10 Java 9 features --release option
Now it is possible to compile against older compliance level by specifying --release option. The new --release compiler option now allows the user to configure compilation against a platform API version of user's choice. The --release option is enabled for JRE 9 and above, if the compliance is set to 1.6 or above

11 Java 9 features - Modules
Project Jigsaw introduced the Java 9 Platform Module System. Module—a uniquely named, reusable group of related packages, as well as resources and a module descriptor (module-info.java) All JDK Modules starts with “jdk.*” All Java SE Specifications Modules starts with “java.*” Java 9 Module System has a “java.base” Module which is an independent module.

12 Java 9 features – Modules (contd..)
Named modules have module defined in module-info.java A class which is not a member of a 'named module' is considered to be a member of a special module known as the unnamed module. The unnamed module 'requires' every other named modules and 'exports' all its packages. Automatic Modules are named modules which are automatically created for a non-modular jar.

13 Java 9 features – Modules (contd..)
Java search now includes a new search scope – Module. Java Build Path allows to add Projects and jars to Modulepath or Classpath Encapsulation properties of Modulepath elements can be modified using Is modular node. Is modular node is changed to Is not modular if the the Build Path Project library is moved to Classpath.

14 Java 9 features – Modules (contd..)
Encapsulation properties of Modulepath elements can be modified using Is modular node. Patching the module, modules for read and exports can be added.

15 Java 9 features – Modules (contd..)
Quick Fix in module-info.java to import class and add requires to module-info.java. Quick Fix in module-info.java to move Classpath entry to Modulepath entry.

16 Java 9 features – Modules (contd..)
Quick Fix in a class to add requires to module-info.java. Quick Fix in import to add requires to module-info.java.

17 Java 9 features – Launch Configuration
“Dependencies” tab with Java Runtime 9.

18 Java 9 features – Launch Configuration
Override Dependencies button has been added to the Dependencies tab. Java 9 has provided many command line options to make older projects compatible to the new modules. Based on Java build path, dependencies are derived. These options from build path can be overridden for launching programs in the module.

19 Java 10 features Local variable type inference support for Java 10.
Auto completion support for “var” Hover Support for “var” Type conversion suggestions Suggestion to change project compliance and JRE

20 Java 10 features Time based release versioning

21 Java 11 features Local variable syntax for Lambda Parameters
Nest-Based Access Control Raw String literals (Not triaged to Java 11) Switch Expressions and Pattern matching (Not triaged to Java 11)

22 Moving from Java 8 to Java 9 and beyond
Create new Java Projects as modular Put Java 8 libraries and Projects in Classpath Put modular libraries and Projects in Modulepath Learn about options ALL-UNNAMED, ALL- DEFAULT, ALL-SYSTEM, ALL-MODULE-PATH Learn about options --add-exports, --add- reads, --add-opens

23 Quick Links Eclipse Photon JDT New and Noteworthy Java 9 Examples
Java 9 Examples Java 10 Examples Java 11 Examples

24 Thank You


Download ppt "Embracing Java 9 and beyond with Eclipse JDT"

Similar presentations


Ads by Google