KEMBAR78
JavaFest. Денис Макогон. 6 заблуждений относительно современной Java | PDF
Copyright © 2020 Oracle and/or its affiliates.
6 signs “someone” has no
clue about modern Java
Principal member of technical stuff

Java Platform Group
Oracle

Date: “Today”
Denys Makogon
Introduction and many more…
Denys Makogon
6
signs of The Apocalypse
6
signs of misconceptions
Since you are here…
ask yourself a few questions
Which version of Java you use?
Is it the latest one?
Why your app is not running against the latest Java version?
Typical answers would be …
I like JDK 8. Why should I run my code on the latest JDK?
I just want a few more goodies so I don't have to learn Kotlin.
Why is Oracle not giving me more stuff?
and the follow-up is…
In order to move forward with Oracle, as you say,
I need to upgrade, but that the amount of work scares me
because I am concerned about…
Java modules (Jigsaw)
Misconception #1
I need to refactor my app to turn it into a set of
modules
If refactoring is not required, then I would
probably ignore them.
App’s JAR is all I have, no way to get modules
involved.
JAVA_MODULES=$(jdeps target/*.jar | grep ".jar -> java." | awk '{print $3}' | tr "n" ',')
JDK_MODULES=$(jdeps target/*.jar | grep ".jar -> jdk." | awk '{print $3}' | tr "n" ',')
jlink --add-modules ${JAVA_MODULES}${JDK_MODULES} --output my-runtime
But jlink and jdeps were introduced as part of Java 11,
but I’m still on “older ”Java version!
if ( myJavaVersion.isOlderThan(“11”) ) {
GOTO “my reasons for not upgrading”
}
Java is not good for the cloud!
Greedy on memory and slow to start…
Misconception #2
Since Java 10…
cgroups limits awareness
+
jdeps since Java 11
jlink since Java 9
+
jdeps since Java 11
+
multi-stage builds
if ( myJavaVersion.isOld() ) {
GOTO “my reasons for not upgrading”
}
Okay, anyways, even with a new release cadence, Java is not
evolving, cool project like Valhalla, Panama, Amber, Loom see
no progress, people only chat about them on the mailing lists.
Misconception #3
All OpenJDK projects with no exact targets are really “applied
research”, the programming model and experience for all of them
is still being worked out. You can't usefully explain these projects
to ordinary developers until that work-out has been done.
While projects don’t have exact target, their design and early
access builds are available for downloading or you can build
one for the particular target platform.
OpenJDK developers need your feedback, so, you probably
need to…
https://twitter.com/denis_makogon/status/1255923781203304449
Always try the preview features.
Please try out early access builds of the JDK or the
particular project.
Share your opinion!
We need your feedback!
But you need to upgrade in
order to try out new features!
So, you want to say that features will take years to deliver, it
feels like there's no real innovation happening with Java
and one is better to learn Kotlin or any other language.
Misconception #4
Q: "OK mate, but those are not ready. When can my team use
this? I have people who want to move to Kotlin yesterday.”
A: "In a few years time. In the meantime, are you ready to
upgrade from JDK 8? Have you run your code on JDK 13?"
JavaFX and Swing are abandoned, and Java is not
worth the time for client-side development.
Misconception #5
OpenJFK is the open source home for JavaFX.
So, is not dead!
https://openjfx.io
Project Lanai
JEP 382
Project Leyden
Native Windows applications using Gluon
Substrate, JavaFX and GraalVM
“Project GraalVM is a research project
created by Oracle with the goal to
replace the HotSpot entirely.”
Misconception #6
-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler
instead of JVMCI options if you want to actually run
JS/Ruby/R
Get the whole GraalVM from graalvm.com
Project Leyden
There might me more of those, Your mission is to be
critical regarding what you’ve heard, just go and try it out
by yourself!
Our goal is to get rid of them, educate.
More misconceptions?
“Project GraalVM is a research project
created by Oracle. We can look at Graal
as several connected projects: a new
JIT compiler that builds on HotSpot
and a new polyglot virtual machine.”
[Update] minus one misconception
https://inside.java
@java
@denis_makogon
@denismakogon
Questions?

JavaFest. Денис Макогон. 6 заблуждений относительно современной Java

  • 1.
    Copyright © 2020Oracle and/or its affiliates. 6 signs “someone” has no clue about modern Java Principal member of technical stuff
 Java Platform Group Oracle
 Date: “Today” Denys Makogon
  • 2.
    Introduction and manymore… Denys Makogon
  • 3.
    6 signs of TheApocalypse
  • 4.
  • 5.
    Since you arehere… ask yourself a few questions Which version of Java you use? Is it the latest one? Why your app is not running against the latest Java version?
  • 6.
    Typical answers wouldbe … I like JDK 8. Why should I run my code on the latest JDK? I just want a few more goodies so I don't have to learn Kotlin. Why is Oracle not giving me more stuff?
  • 7.
    and the follow-upis… In order to move forward with Oracle, as you say, I need to upgrade, but that the amount of work scares me because I am concerned about…
  • 8.
  • 9.
    Misconception #1 I needto refactor my app to turn it into a set of modules
  • 10.
    If refactoring isnot required, then I would probably ignore them.
  • 11.
    App’s JAR isall I have, no way to get modules involved.
  • 12.
    JAVA_MODULES=$(jdeps target/*.jar |grep ".jar -> java." | awk '{print $3}' | tr "n" ',') JDK_MODULES=$(jdeps target/*.jar | grep ".jar -> jdk." | awk '{print $3}' | tr "n" ',') jlink --add-modules ${JAVA_MODULES}${JDK_MODULES} --output my-runtime
  • 13.
    But jlink andjdeps were introduced as part of Java 11, but I’m still on “older ”Java version! if ( myJavaVersion.isOlderThan(“11”) ) { GOTO “my reasons for not upgrading” }
  • 14.
    Java is notgood for the cloud! Greedy on memory and slow to start… Misconception #2
  • 16.
    Since Java 10… cgroupslimits awareness
  • 18.
  • 19.
    jlink since Java9 + jdeps since Java 11 + multi-stage builds
  • 20.
    if ( myJavaVersion.isOld()) { GOTO “my reasons for not upgrading” }
  • 21.
    Okay, anyways, evenwith a new release cadence, Java is not evolving, cool project like Valhalla, Panama, Amber, Loom see no progress, people only chat about them on the mailing lists. Misconception #3
  • 22.
    All OpenJDK projectswith no exact targets are really “applied research”, the programming model and experience for all of them is still being worked out. You can't usefully explain these projects to ordinary developers until that work-out has been done.
  • 23.
    While projects don’thave exact target, their design and early access builds are available for downloading or you can build one for the particular target platform. OpenJDK developers need your feedback, so, you probably need to…
  • 24.
  • 25.
    Always try thepreview features. Please try out early access builds of the JDK or the particular project. Share your opinion! We need your feedback!
  • 26.
    But you needto upgrade in order to try out new features!
  • 27.
    So, you wantto say that features will take years to deliver, it feels like there's no real innovation happening with Java and one is better to learn Kotlin or any other language. Misconception #4
  • 28.
    Q: "OK mate,but those are not ready. When can my team use this? I have people who want to move to Kotlin yesterday.” A: "In a few years time. In the meantime, are you ready to upgrade from JDK 8? Have you run your code on JDK 13?"
  • 30.
    JavaFX and Swingare abandoned, and Java is not worth the time for client-side development. Misconception #5
  • 31.
    OpenJFK is theopen source home for JavaFX. So, is not dead! https://openjfx.io
  • 32.
  • 33.
  • 34.
    Native Windows applicationsusing Gluon Substrate, JavaFX and GraalVM
  • 35.
    “Project GraalVM is a researchproject created by Oracle with the goal to replace the HotSpot entirely.” Misconception #6
  • 38.
  • 39.
    instead of JVMCIoptions if you want to actually run JS/Ruby/R Get the whole GraalVM from graalvm.com
  • 40.
  • 41.
    There might memore of those, Your mission is to be critical regarding what you’ve heard, just go and try it out by yourself! Our goal is to get rid of them, educate. More misconceptions?
  • 42.
    “Project GraalVM is a researchproject created by Oracle. We can look at Graal as several connected projects: a new JIT compiler that builds on HotSpot and a new polyglot virtual machine.” [Update] minus one misconception
  • 43.
  • 44.