Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Java 9: Platform
Jigsaw: цели
Простота
Безопасность
Эффективность
Jigsaw: решение
Модули
Анатомия модуля
Fun.java
meetups.properties
module jprof {
requires space;
exports knowledge;
provides Meetups with
Fun;
}
Jigsaw: JEPs
● JEP 200: The Modular JDK
● JEP 260: Encapsulate Most Internal APIs
● JEP 261: Module System
● JEP 220: Modu...
JEP 200: The Modular JDK
http://cr.openjdk.java.net/~mr/jigsaw/jdk9-module-summary.html
JEP 260: Encapsulate Most Internal APIs
● Публичные
○ java.*
○ javax.*
○ com.sun.*
● Внутренние
○ sun.*
JEP 260: Encapsulate Most Internal APIs
Внутренние API:
● Некритичные
(sun.misc.BASE64Decoder → j.u.Base64)
● Критичные (s...
JEP 260: Encapsulate Most Internal APIs
● Неиспользуемые: инкапсулированы
● С заменой: инкапсулированы
● Остальные:
○ Поме...
disruptor-3.3.7.jar -> jdk.unsupported
c.l.d.MultiProducerSequencer -> sun.misc.Unsafe (jdk.unsupported)
c.l.d.RingBufferF...
Unnamed & Automatic modules
Экспортируют всё
Имеют доступ ко всему
Classpath is (not) gone
--module-path --classpath
Plain old JAR Automatic module Unnamed module
Module JAR “True” module U...
jdk.unsupported
module yaoming {
requires jdk.unsupported;
}
VarHandle
Unsafe#getInt(Object, long)
Unsafe#putInt(Object, long, int)
Unsafe#compareAndSwapInt(Object, long,
int, int)
Va...
JEP 261: Module System
● --module-path и co.
● Новые поля в *.class-файлах
● Modular JAR files
● JMOD
JEP 220: Modular Run-Time Images
├── bin
│ ├── app
│ ├── java
│ └── keytool
├── conf
│ └── *.properties
├── legal
├── lib
...
JEP 282: jlink: The Java Linker
Modules
Module runtime image
bin jmods …libs
jlink
Jigsaw: выгода
jlink
JEP 238: Multi-Release JAR Files
├── A.class
├── B.class
├── C.class
├── D.class
└── META-INF
├── MANIFEST.MF // Multi-Rel...
String enhancements
● JEP 250: Store Interned Strings in CDS Archives
● JEP 254: Compact Strings
● JEP 280: Indify String ...
JEP 226: UTF-8 Property Resource Bundles
java.util.ResourceBundle != java.util.Properties
http://openjdk.java.net/jeps/226
JEP 267: Unicode 8.0
http://openjdk.java.net/jeps/267
JEP 223: New Version-String Scheme
http://openjdk.java.net/jeps/223
JEP 223: New Version-String Scheme
Что безопаснее: JDK 8u60, или JDK 8u51?
JEP 223: New Version-String Scheme
Сколько релизов между 8u51 и 8u60?
JEP 223: New Version-String Scheme
$MAJOR.$MINOR.$SECURITY
1.9.0.0 -> 9.0.0
JEP 223: New Version-String Scheme
8u51 -> 8.2.6
8u60 -> 8.3.6
8u65 -> 8.3.7
8u71 -> 8.3.8
JEP 248: Make G1 the Default Garbage Collector
http://openjdk.java.net/jeps/248
Уменьшение пауз
Иной memory layout
Recap
● Jigsaw, модули
● jlink
● Multi-release JARs
● String enhancements
● UTF-8 ResourceBundles
● Unicode 8.0
Q&A
Java 9: Platform
Java 9: Platform
Java 9: Platform
Upcoming SlideShare
Loading in …5
×

Java 9: Platform

177 views

Published on

Special for Java Professionals BY Meetup #16. Java 9 platform changes.

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Java 9: Platform

  1. 1. Java 9: Platform
  2. 2. Jigsaw: цели Простота Безопасность Эффективность
  3. 3. Jigsaw: решение Модули
  4. 4. Анатомия модуля Fun.java meetups.properties module jprof { requires space; exports knowledge; provides Meetups with Fun; }
  5. 5. Jigsaw: JEPs ● JEP 200: The Modular JDK ● JEP 260: Encapsulate Most Internal APIs ● JEP 261: Module System ● JEP 220: Modular Run-Time Images ● JEP 282: jlink: The Java Linker
  6. 6. JEP 200: The Modular JDK http://cr.openjdk.java.net/~mr/jigsaw/jdk9-module-summary.html
  7. 7. JEP 260: Encapsulate Most Internal APIs ● Публичные ○ java.* ○ javax.* ○ com.sun.* ● Внутренние ○ sun.*
  8. 8. JEP 260: Encapsulate Most Internal APIs Внутренние API: ● Некритичные (sun.misc.BASE64Decoder → j.u.Base64) ● Критичные (sun.misc.Unsafe)
  9. 9. JEP 260: Encapsulate Most Internal APIs ● Неиспользуемые: инкапсулированы ● С заменой: инкапсулированы ● Остальные: ○ Помечены @Deprecated ○ Будут инкапсулированы или удалены ○ Доступны для использования через
  10. 10. disruptor-3.3.7.jar -> jdk.unsupported c.l.d.MultiProducerSequencer -> sun.misc.Unsafe (jdk.unsupported) c.l.d.RingBufferFields -> sun.misc.Unsafe (jdk.unsupported) c.l.d.Sequence -> sun.misc.Unsafe (jdk.unsupported) c.l.d.util.Util -> sun.misc.Unsafe (jdk.unsupported) c.l.d.util.Util$1 -> sun.misc.Unsafe (jdk.unsupported) JDK Internal API Suggested Replacement ---------------- --------------------- sun.misc.Unsafe See http://openjdk.java.net/jeps/260 jdeps: check yourself before you wreck yourself
  11. 11. Unnamed & Automatic modules Экспортируют всё Имеют доступ ко всему
  12. 12. Classpath is (not) gone --module-path --classpath Plain old JAR Automatic module Unnamed module Module JAR “True” module Unnamed module
  13. 13. jdk.unsupported module yaoming { requires jdk.unsupported; }
  14. 14. VarHandle Unsafe#getInt(Object, long) Unsafe#putInt(Object, long, int) Unsafe#compareAndSwapInt(Object, long, int, int) VarHandle#get(Object…) VarHandle#put(Object…) VarHandle#compareAndSet(Object…)
  15. 15. JEP 261: Module System ● --module-path и co. ● Новые поля в *.class-файлах ● Modular JAR files ● JMOD
  16. 16. JEP 220: Modular Run-Time Images ├── bin │ ├── app │ ├── java │ └── keytool ├── conf │ └── *.properties ├── legal ├── lib │ ├── … │ ├── modules │ └── *.so └── release
  17. 17. JEP 282: jlink: The Java Linker Modules Module runtime image bin jmods …libs jlink
  18. 18. Jigsaw: выгода jlink
  19. 19. JEP 238: Multi-Release JAR Files ├── A.class ├── B.class ├── C.class ├── D.class └── META-INF ├── MANIFEST.MF // Multi-Release: true └── versions ├── 9 │ ├── A.class │ └── B.class └── 10 └── A.class http://openjdk.java.net/jeps/238
  20. 20. String enhancements ● JEP 250: Store Interned Strings in CDS Archives ● JEP 254: Compact Strings ● JEP 280: Indify String Concatenation
  21. 21. JEP 226: UTF-8 Property Resource Bundles java.util.ResourceBundle != java.util.Properties http://openjdk.java.net/jeps/226
  22. 22. JEP 267: Unicode 8.0 http://openjdk.java.net/jeps/267
  23. 23. JEP 223: New Version-String Scheme http://openjdk.java.net/jeps/223
  24. 24. JEP 223: New Version-String Scheme Что безопаснее: JDK 8u60, или JDK 8u51?
  25. 25. JEP 223: New Version-String Scheme Сколько релизов между 8u51 и 8u60?
  26. 26. JEP 223: New Version-String Scheme $MAJOR.$MINOR.$SECURITY 1.9.0.0 -> 9.0.0
  27. 27. JEP 223: New Version-String Scheme 8u51 -> 8.2.6 8u60 -> 8.3.6 8u65 -> 8.3.7 8u71 -> 8.3.8
  28. 28. JEP 248: Make G1 the Default Garbage Collector http://openjdk.java.net/jeps/248 Уменьшение пауз Иной memory layout
  29. 29. Recap ● Jigsaw, модули ● jlink ● Multi-release JARs ● String enhancements ● UTF-8 ResourceBundles ● Unicode 8.0
  30. 30. Q&A

×