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

Modern Java with IntelliJ IDEA

Trisha Gee
October 27, 2020

Modern Java with IntelliJ IDEA

The current release cadence of a new version of Java every 6 months can be overwhelming. The releases might even contain preview features which are "complete" but may change with every new release until they finally stabilize. How can a real developer keep up with this? The good news is that your IDE can help. IntelliJ IDEA not only provides support for the latest versions of Java (even the ones that aren't released yet), it can also help us to discover and use the new language features. This way we can let the IDE help us to migrate to the latest and greatest, and we don't need to go researching for the relevant features every 6 months. In this session, Trisha will show the interesting language features in recent versions of Java, and show how IntelliJ IDEA makes these really easy to find and use.

Trisha Gee

October 27, 2020
Tweet

More Decks by Trisha Gee

Other Decks in Programming

Transcript

  1. IntelliJ IDEA
    ©JetBrains. All rights reserved
    Modern Java with
    IntelliJ IDEA
    Trisha Gee (@trisha_gee)
    Java Champion & Java Advocacy Lead, JetBrains

    View full-size slide

  2. Define “Modern
    Java”

    View full-size slide

  3. https://www.jetbrains.com/lp/devecosystem-2020/java/
    Despite the emergence of newer
    versions, Java 8 is still most
    beloved. It is used by 3/4 of Java
    developers. Java 11 is growing
    more popular. Compared to last
    year, its usage has increased by
    10 percentage points.

    View full-size slide

  4. https://flic.kr/p/8xhk74

    View full-size slide

  5. Java 11
    Long Term Support (LTS) Release; ~3 years support

    View full-size slide

  6. Java 15
    Current release; be prepared to upgrade in March 2021

    View full-size slide

  7. IntelliJ IDEA can
    help you

    View full-size slide

  8. Super happy with Java 8,
    thanks

    View full-size slide

  9. Java 11

    Long Term Support (LTS) Release

    View full-size slide

  10. Convenience Factory Methods for
    Collections

    View full-size slide

  11. Collecting to Unmodifable Collections

    View full-size slide

  12. New Methods on Optional

    View full-size slide

  13. Java 15

    Current Release

    View full-size slide

  14. Switch Expressions

    View full-size slide

  15. Switch Expressions
    https://jb.gg/ij-jdk12

    View full-size slide

  16. Text Blocks
    https://jb.gg/ij-jdk13

    View full-size slide

  17. Preview Features

    View full-size slide

  18. Pattern Matching for instanceof

    View full-size slide

  19. Pattern Matching for instanceof
    https://jb.gg/ij-jdk14

    View full-size slide

  20. Records
    https://jb.gg/ij-jdk14

    View full-size slide

  21. Sealed Types

    View full-size slide

  22. Sealed Types
    https://jb.gg/ij-jdk15

    View full-size slide

  23. Tips for Migration

    View full-size slide

  24. http://bit.ly/8-to-11

    View full-size slide

  25. Address compiler warnings

    View full-size slide

  26. Address compiler warnings
    …they are there for a reason

    View full-size slide

  27. Update your dependencies

    View full-size slide

  28. Update your dependencies
    And add new ones

    View full-size slide

  29. Update your build tool

    View full-size slide

  30. Update your build tool
    Updated Maven and Gradle required

    View full-size slide

  31. Let your tools do
    the hard work

    View full-size slide

  32. http://bit.ly/ij-modern-java
    @trisha_gee

    View full-size slide