How to Upgrade to Java 21

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ธ.ค. 2024

ความคิดเห็น • 31

  • @shounak616
    @shounak616 ปีที่แล้ว +8

    What's wrong with dynamic agent loading, I thought Mockito was a good UT Mocking framework? is there anything I should know about it?

    • @diegoshevek5927
      @diegoshevek5927 ปีที่แล้ว +4

      You'll still be able to use it

    • @nipafx
      @nipafx ปีที่แล้ว +7

      There's nothing wrong with dynamic loading of agents but it should happen with the user's explicit consent and so it will probably require a command line flag in the future. As preparation, it now logs a warning.
      Details: openjdk.org/jeps/451
      NB: The descriptions usually contain lots of follow-up links and in this one, JEP 451 is among them. In case you don't want to have to wait for a reply to your question. 😊

  • @hausi78
    @hausi78 ปีที่แล้ว +7

    So nice to hear about all those precious Java 17 and Java 21 features. If only Oracle would update WebLogic Server to be able to use a Java version > 11... 🤬

    • @delabassee
      @delabassee ปีที่แล้ว +2

      Please see blogs.oracle.com/weblogicserver/post/the-promise-of-using-java-virtual-threads-with-oracle-weblogic-server

  • @shaunreich
    @shaunreich ปีที่แล้ว +4

    I think it would be very beneficial to mention OpenRewrite in all of these Java version videos
    They've already got a lot of recipes to migrate and refactor, from spring to JDK versions. It can also rewrite to prefer more modern types and functions
    The more attention this project gets, the more contributions, and the more assistance people will get, which will then help keep people on modern Java versions easier
    Haven't used it yet myself though but it looks really promising, and can be broken down my JDK versions, run from the toolchain, or cli

    • @nipafx
      @nipafx ปีที่แล้ว

      OpenRewrite is definitely very interesting but I haven't used it neither and hence don't want to propose it as a solution on this channel. But I definitely recommend checking it out.

  • @RainerJung
    @RainerJung ปีที่แล้ว +3

    I'm building my application in docker images. I'm using the eclipse-temurin images. They don't have ea builds. As far as I remember, openjdk docker images are outdated, but they do have ea-builds.
    Is there a recommendation which images to use?

    • @delabassee
      @delabassee ปีที่แล้ว +3

      Yes, the Oracle's setup-java action supports the Oracle JDK, the latest and greatest OpenJDK Builds *and* the OpenJDK Early-Access builds, see github.com/oracle-actions/setup-java

  • @stcattc
    @stcattc ปีที่แล้ว +3

    @nipafx I have apps on gradle 8.3 with java 20 no docker, runs on bare metal (cpu pinning and other perfomance requirements).
    How do you suggest a setup that can allow for building on 21/22 without having to wait until gradle 8.4 is releeaed? Even if I was to run gradle with java 20 which is supported, it still does not allow compiling to > 21.
    Interested on your thoughts on an approach.

    • @nipafx
      @nipafx ปีที่แล้ว +2

      I'm far from a Gradle expert but I think their JVM toolchain is the way to go?

    • @shaunreich
      @shaunreich ปีที่แล้ว +3

      I think Jvm tool chains is the answer as the other person said. This is really what you should use anyways regardless. This way you don't need to tie your runtime to your toolchain version. Plus, it ensures less variability. You ensure that all of your devs have the same JDK version from the particular vendor. It should allow you to say, run Gradle with 17 and compile to 20. Or is there a specific limitation for this with 21? I'm less familiar in this area

    • @stcattc
      @stcattc ปีที่แล้ว +4

      @@shaunreichyes seems to be the move. Strange how they don't mention this in their compatibility matrix. Wil give this a shot. Thanks for the tips.

    • @delabassee
      @delabassee ปีที่แล้ว +2

      Check inside.java/2022/12/12/sip073/ for some details on Gradle Toolchain

    • @shaunreich
      @shaunreich ปีที่แล้ว

      ​@@stcattcthat is a bit strange. Feel free to open an issue and or pull request to correct those docs for the next person like you, who runs into it

  • @JakeDMaier
    @JakeDMaier ปีที่แล้ว +5

    I'll be coming from 11, so what else do I need to know

    • @nipafx
      @nipafx ปีที่แล้ว +2

      There are a few more things between 11 and 17 to look out for, but I don't think I collected them in one place as I did here. And I forgot all the small things, so you should really look into the release notes, particularly the sections I point out in the video at 8:23. On the larger side of things, you can look up JEPs 363, 372, 398, 403, and 407. I hope that helps. :)

    • @mahee96
      @mahee96 ปีที่แล้ว +1

      ⁠@@nipafx I am working on jdk 8 to 11 upgrade for our java stack applications, but I see that they used reflection a lot and some third party libs use it too.
      so we faced issues with most packages and had to do -add-exports, -add-reads, -add-opens cmdline args to mitigate them. Now that in java 17, the cmdline based override is not present.
      What do you recommend the key breaking changes that I need to lookout for upgrade to 17 coming from java 8 and been on java 11 for sometime

    • @nipafx
      @nipafx ปีที่แล้ว +1

      ​@@mahee96 The command line arguments you mention are all present in 17 and are in no danger of being removed. You're probably thinking of --illegal-access, which was removed in 17 by JEP 403. I actually think that that is the biggest migration challenge for most projects because many didn't do the hard work you did and just slapped --illegal-access on. Other than that, I can't add anything to my comment above, where I listed a few JEPs and pointed our where to learn more.
      (Sorry for the late reply, I missed the notification.)

    • @mahee96
      @mahee96 ปีที่แล้ว

      @@nipafx sure Thanks, some major dependencies that used to work such as xstream (for serializing objects to xml) is having issues due this change because they use deep reflection to perform the serialization.
      At the very least this gives me hope that we are at the end of the tunnel without having to bother about the overrides being removed any sooner.
      Thanks for the reply, great content!

  • @onebeartoe
    @onebeartoe ปีที่แล้ว +5

    Update little by little, generational children!

  • @TomConder
    @TomConder ปีที่แล้ว

    I spotted the Pandemic board game. Good taste!

  • @nonnnth
    @nonnnth ปีที่แล้ว

    Where I work, they’re still using java 8.

  • @gugolinyo
    @gugolinyo ปีที่แล้ว

    I hope you don't think when you chose a hashtag it becomes reserved for your channel only. Maybe take a look of what comes up for the hashtag first. And if you didn't, maybe change it now.

  • @michaelangelojohnsonlucas7552
    @michaelangelojohnsonlucas7552 ปีที่แล้ว +5

    Java coffee and a Tannenzäpfle

    • @nipafx
      @nipafx ปีที่แล้ว +3

      I don't actually drink coffee, so I need other ingredients to adjust my chemical balance.😊

  • @musashi939
    @musashi939 ปีที่แล้ว +2

    Haha metal construction work. I know that reference. ❤

    • @nipafx
      @nipafx ปีที่แล้ว

      That dude (and video) is amazing! 🤘

  • @TappivTheReal
    @TappivTheReal 2 หลายเดือนก่อน

    im only here so i can play a minecraft mod

  • @SahilSawant-td1pw
    @SahilSawant-td1pw ปีที่แล้ว +2

    Hey Java , really nice video! I was wondering if I could help you edit your videos and also make a highly engaging Thumbnail which will help your video to reach to a wider audience .