Foojay Podcast #73: JCon Report, Part 2 – Evolutions in the Java language and runtime
JavaJava Core

Foojay Podcast #73: JCon Report, Part 2 – Evolutions in the Java language and runtime

In the second part of our JCON interviews, recorded at the conference in May, we focuses on general evolutions within the Java world and how they influence how we write code and develop applications. We take a look back at the history of Java, discuss new features in the latest release, how Java evolves with OpenJDK projects and JEPS, how Java is used in education, and much more…

Video

Podcast Apps

You can listen and subscribe to the Foojay Podcast on:

Content

00:00 Introduction

00:19 Steve Poole – Java APIs in a modern way, History of Java
https://www.linkedin.com/in/noregressions

06:42 Hanno Embregts - Java 24, Java in education
https://www.linkedin.com/in/hannotify/

12:20 Karl Heinz Marbaise - Stream gatherers, Java evolutions, JEPs, Java stability
https://www.linkedin.com/in/khmarbaise/

26:19 Cay Horstmann - Project Valhalla, Project Loom, JEPs, OpenJDK projects
https://www.linkedin.com/in/cay-horstmann-659a4b/

34:20 Miro Wengner - Java modules, Robo4J
https://www.linkedin.com/in/mwengner/

37:52 Dmitry Chuyko – Improve startup and performance of Java applications in containers
https://www.linkedin.com/in/dchuyko/

42:26 Jens Knipper - Receiving emails with Java, Java improvements over time, writing on Foojay
https://www.linkedin.com/in/jens-knipper-87b4a717b/
https://foojay.io/today/receiving-mails-in-java-with-imap-or-pop3/

46:55 Conclusion

Transcript

Automatically generated from the audio, so it can contain errors in names and technical terms. Suggest a correction.

[0:00] This is the second part of our JCON interviews which were recorded at a conference in May. Welcome to the Foojay podcast, all your news about OpenJDK. This episode focuses on general evolutions within the Java world and how they influence how we write code and develop applications. Let’s start with Steve P who spoke at the conference about designing Java APIs in a modern way. I asked him what he meant by modern way and we looked back at the history of Java. Historically, we’ve taught people to follow the sorts of API standards design thoughts that were re that were around before Java started. So like solid and things like that. And if you look at AWT specifically is a really good example of we have interfaces and abstract classes and concrete methods and concrete classes and things like that. And they were reasonably good ideas when they were created, but since then we’ve moved on and we now have streams and we have records and sealed interfaces and a whole bunch of stuff that if you use them in the right way give you a much more flexible and reliable API that you can continue to extend. because

[1:15] One of the scary things is that if you’re a follower of a thing called sever semantic versioning know the three dot the three okay the idea is that that’s a signal to your users as to whether things are going to change. So you have three points one the lowest one says I’m just fixing bugs another one says here’s a new feature or modify and the top one says hey there could be a breaking change. Unfortunately, when you look at the stats from Maven Central, it tells you that it doesn’t matter what changes, whether it’s the first, the second, third, there’s likely to be a breaking change. It’s like 30% chance every time. And so that means that we’re not developers don’t understand how to write evolving APIs. And so I’m here to talk about a way of using sealed classes and just different design patterns to give you another way of thinking about how to do this. So that’s what I’m doing. And I’m also going to tweak their nose a bit about what they know about how Java works because what I’ve also discovered doing this is that lots of people don’t realize some of the edges and they get bitten. Okay. The

[2:23] Corner cases as they call them. it’s very interesting that you say a lot has changed. Java has changed a lot. what was your first Java version? Oh, 0.99 A I think. So let’s conclude you were there from the start. 30 years of Java. Yeah, pretty much. I did I wasn’t in the IBM Java team at the very first day though I was working with them. So a few months after the IBM Java team had started I joined yeah so wor there and my very first thing was to work on a thing called AS400 and so my claim to fame is I produced the very first 64bit JVM that was compliant. but and then after that well I was running the Java team on and off in various ways for years working for a team that did Java on 22 different platforms. So that’s a nice list. what is the most well a few of the most important changes what happened in Java? Oh from the from a language point of view well obviously we’ve got virtual threads now that’s going to be interesting to see how that p pans out. But that’s obviously a big thing.

[3:38] But from an API point of view from a general stuff it’s got to be the streams it’s got to be the lambdas. I mean those sorts of things. And then I like all the little language tweaks that have gone through. But streams and lambdas I think just makes it a completely different environment. You can write code and do things in a much more optimal way than you could ever do before. And then you have these new stream gathers that appeared I think in 24 25 I don’t know exactly when. so it proves that still something which was already a major change cannot even be further improved. Yes, that’s true. And what happens history shows this is that you put out something, you think you’ve got it right and then people use it and then you find that there are different use cases than you expected or there were performance characteristics or in the example I think with the gatherers is that people get very confused how to use streams and they ended up with a bunch of ways of writing them that were not particularly optimal.

[4:42] So I think I really like the fact that the Java team learned from these things and go, “Hey, we can fix that for you. We can solve problems that you’ve you’ve come across that we perhaps weren’t aware of or maybe we did but we didn’t think was high priority.” And absolutely it continues to evolve. I really don’t see it changing. Yeah. Is that also why these preview features are so important that they can be used but you should not use them in production yet? Yeah. I again it’s you should try them out you know you shouldn’t ignore them you should certainly use them and give feed give feedback I think if you feed back to the Java team what you think of this stuff and there are enough people out you know the Java team the deval team they’ve got is there’s a lot of people feedback your views on this stuff I think it’s given that the release train the process they have is exactly right to say we’re giving a preview and then it may change tomorrow you know it may may go in production. I think it’s a perfect way of getting to use this, provided, of course, you’re willing to use the next

[5:44] Version. Yeah. Yeah. You should keep track of the versions and always jump to the latest one. what are you looking forward to? Oh, in Java, I’m not sure I’m keeping track of what’s going I mean, there’s just so much stuff coming out. what am I looking forward to? No, I’m the gathering stuff I was keeping an eye on. So, that’s the next thing I really want to play with. and with this API design thing that I’m that I’ve been promoting, I want to see I need to do more with that. I need to show more people more how to do that. So, I’m not sure I’m looking so much at new features. I think with streams and lambdas that there’s so much more possibility to write different sorts of code. You know, we can look at a whole bunch of API designs that return sets and arrays and things like that. Think about turning them into a stream. Think about different ways of using the streams.

[6:41] Yeah. Hano Embra is a regular guest on this podcast. At the conference, we discuss the new features in Java 24 and how Java is used in education. He explains how you can become an expert by educating others or giving a talk. It’s a very good thing also to start teaching a subject if you want to grasp it fully because it’s one thing to study a subject and apply it and you’re kind of forgiving for yourself if you don’t grasp everything. You’re you will you’ll be like okay I’ll I’ll grasp that in a few months or I’ll just ask a coworker about it and then you tend to forget that and then there’s this tiny gap in your knowledge that you never you’re never forced to learn it. But if you have to explain a topic to your students, you want to be on top of everything that you’re telling them.

[7:33] So if you’re like 90% sure that you know a subject, then start teaching it and then you have to learn a bit more. Then you find the missing 10%. Right? You find the missing 10% and that’s that is the basis for this talk. So I had a three or four course days about Jakarta and I’ve put all the questions that I had. So the final 10% in a talk that and then I demonstrate the 10% of questions I had using live coding and a few slides to back it up. So that’s you’re not only talking about Java and Jakarta, you’re also writing a lot about it on Foojay. Thanks for that. Java 24 was an important one and a major blog post. Yeah, it was I think I started with Java 20 to summarize the content of the Java release mainly so that I could explain it in a simpler way to the people I teach because reading through all the gaps is doable but you know it is it’s kind of there’s a lot of jargon there and that’s no no surprise because the people who write it work on Java full time, right? so I just want to paraphrase the Japs in a way that it is more people can relate to it

[8:45] Better. So I tend to use my own examples domains that is are very relatable. yeah and that is the way I like to describe each Java release. And so when Java 24 came out few months ago I was teaching a class of students again and while they walked in the room I just had the Foojay homepage open right and they sat down and I said congratulations everyone and they said with what is it your birthday and I said no no Java 24 was released today and they stared at the screen for a while and they said hey isn’t that an article by you and I looked behind me and I said oh now now that you mentioned it that is an article by me right I didn’t know it was up there and they didn’t believe me of course but I said by the way this is Foojay and you know you can catch up with the latest news in Java in the same way as I do just check out the website it is not black magic or something and it’s just keep track of the right resources so that’s what they call shameless self-promotion yes yes but when you’re a teacher you can do that right and get away with it so

[9:47] You’re teaching Java in education is that a typical Dutch thing that there is a lot of Java in schools. Is that an important language for the Netherlands? Well, that’s a good question. So, when I was in college, it was an important one because the teachers felt that it was a very easy way to learn object orientation and easier than the alternatives that were available back then. But, you know, I I’ I’m past 40, so what do I know? But yeah, the students that I teach right now, they said they only got taught Python in their education and now that they’re employed by by a Dutch government agency they are asked to learn Java or they could choose to learn C# or Java and some of them chose Java because they liked they like the sound of the language and the other half just chose it because there were no positions left in the C track. But now that I’ve taught them for like two months or three months, they’re like, I think Java is my favorite language now.

[10:45] So that got me thinking, we should really be ahead of this, right? Don’t leave it to chance, but make sure that more people fall in love with Java. And I asked them, what made you change your mind? And they said, well, all our fellow students said Java is very old and verbose. And then they got told Java 24 by me. And they’re like, wow, that’s kind of a modern feature. pattern matching and the switch expressions and the records that’s very very concise and elegant and I said well I think your fellow students didn’t read up on the latest version of Java so isn’t that something which returns that people who think Java is for verbose is old is slow that they are stuck on Java 8 probably in some kind of project that they are working on yeah I think that must be the explanation and also when these students got told Java probably it was an older version so I think we’ve got a tasker as community to you know educate the people who are educators and ask them to use the latest versions.

[11:43] Will we have a blog post about Java 25 in September? Probably. Yes. I think I saw a first list with Jeeps. It’s smaller than 24, right? It looks like it’s going to be a smaller release until now. Yeah. Yeah. I already saw the structured concurrency fifth preview. I’m very excited about that because it had some has some API improvements. they didn’t make that didn’t make the cut for Jav 24. So I’ll definitely write something about that. Yeah. Looking forward because it’s the next long-term support version which we will see a lot in production mainly. Yeah. Yeah. Hopefully. Carl Hines Marbza has a long history in Java development and within the community. He explains what recently changed in stream gatherers and how many decisions made about changes in Java are related to future evolutions while still focusing on the stability of the complete Java system. I’m working as a Java developer from for about 20 years in the meantime and I have today a talk today about stream gatherers today. I’m also a Java champion and doing a lot of work in open source for like like the Apache Maven project the PMC

[12:56] Former chairman and things like that. Okay. A lot of activity in the community. yeah, I think the community is very important in open source in general because without the community you’re you’re not really relevant in any way. So in any way you combine things what you think and what the community thinks and combine that into maybe new ideas or just working together with the community or just sharing some ideas or discussion things like that what is happening here on Jcon as well because you’re meeting so many people here and just talking about ideas or what is going on and things how people are thinking about specific stuff for details or what you think could be new ideas how to evolve things or something like that. Okay. back to your talk. So it’s about stream cutters. what changed? What’s the most important change in the le recent Java versions? I would say the opening and some interfaces and possibilities to give more opportunities to the developers in their hand because stream API for example has been introduced in Java 8 for example and it’s a long time there. In

[14:10] The meantime, we have a long time there. and you come to the point that there are some limitations in there. For example, you know, a collector is a terminal operation and you have the intermediate operation like map, flatmap and things like that. But exactly that point the stream gatherers is opening for the intermediate operations and that gives you more opportunities to make your code more readable, more understandable, more maintainableility or better maintainability and gives you things to express your ideas in a more better way than it could be done today because so many people are using that. It’s a very good thing but sometimes you have to do some operations and collect things first create a list in an intermediate list or something like that to continue then working on that but the stream gatherers give makes it open to implement your own intermediate operations which makes it more easier to understand maintainable and often to reduce the number of intermediate results. So it also saves sometimes a lot of memory. So you don’t need to create a list and work on that.

[15:23] So you can do that directly and start working on the intermediate results. So that’s the thing. It’s becoming more open and more give you more opportunities. It’s not perfect of course and also the stream API is not not perfect and has some limitations of course but it makes it more easy more easier to use. That’s I think that’s the most important thing over the time. Yeah. Is that how Java evolves the feedback from the community? We love that this was added but we have some limitations that we want to get fixed. Yeah, if you think about that because at the beginning the stream API was a very good thing. Many people needed to get used to it because they said okay I will stuck with the traditional loops or something like that. Many people complained about performance and things like that at the beginning, but that has changed over the time a lot in a lot of ways. For example, with Java 11 1721 and things like that, but then the feedback if you take a look based on how it is changed and the take a look into the Japs and see the reference to the buck reports into the gyro there, you

[16:33] See people are complaining in some ways about that. Okay, that would be a good functionality into the stream API or things like that. But the problem from this p perspective of the language designers or the library designers in that way is what kind of functionality should we introduce for which are so general that everybody body will take an advantage of that and that’s very complicated decision to make. So the end of this discussion I think was to make more an interface or something some kind of intermediate like the stream that was for example done so to make it open that a developer can do it on its own. So you don’t need to wait oh sometimes in the future there will be some enhancement there. So it makes it easier for us to use it in particular in special situations because one domain is different than the other and one developer likes something like that instead of that or something like that these discussions and I think that makes it more or less useless to discuss about that. So you have the tool set here now to do that in your own way. Is that what happens a lot in Java that some

[17:49] Kind of libraries get implemented into Java like you had Lombok to remove boiler plate but then you had records which actually replace a lot of the Lombok functionality. Do you see more of those cases? I would say the first thing that the idea of records was not to reduce boilerplate code. The idea was to have a nominal type of data carrier which is immutable in itself which is not 100% correct because if you put a list on that you know on a record it’s not immutable anymore but the idea makes sense in several ways in particular if you think it about the relationship with sealed classes for example or interfaces and the all this stuff and if you put that together you get algebraic data types which is a very good things.

[18:39] So that makes it easier to go that way and solve other problems. And it is also very important to integrate that over the time because many people you see okay this point and this point has been enhanced but many people lack the view from a 30,000 ft bird’s view because you don’t see the combination because you have some features some pics here some something there but if you go some steps backwards and see if you get the overall picture for example with the algebraic type types that’s very important to see that and many people discussed that about lumbar and things like that or records just reduce boiler plate that was only a small part of that because then things like switch expressions and things like that combined to that makes it much more powerful and I think that’s the most important thing over the time that it is had been handled by language architect in a very good way which I think it’s a really hard job to do in the right way over the time to do that in the right way and make these combinations over the time all over to get a total better result than just picking this feature

[19:56] For example. Yeah, I heard I think it’s presentation already a few years ago that the way records were designed was to one day be able to handle them better in switch expressions. So there is from the start an ID. It’s not now but soon it will work this way. Yeah. For example, as you mentioned the switch expressions for example, if you do that and combine that with pattern matching, for example, then you have exactly that point. The records are one thing which is a very good thing. Yes, of course, it reduces some boiler plate. I think it’s a nice nice thing to have that. But in the end you can combine that with the many things like pattern matching and then you have a switch expression where you can use a record as a type and things like that and combine that to much more powerful things. And if you combine that to for example see classes implementation because a record can implement an interface and then you can combine these things and that makes very powerful things possible which many people complain about in the beginning. know use Cotlin or something like that or Scala or Okamel or whatever we are

[21:08] Talking about but over the time if you combine these things then you can get very powerful things and many people unfortunately don’t really know the new things in Java over the time because they say oh we are 11 17 21 and don’t know the new features because they don’t really read that or understand that maybe or have not the time maybe don’t blame or someone but it’s very hard dropped or very challenging to be up to date with these new features and I think the feedback from the community to the language architects and the OpenJDK developers is a very very important thing to see okay that feature works or that works not or something like values values the vector things all that stuff is very important to get that these these these feedback loops here because the language architects and many developers on the OpenJDK are working on that but the whole world is maybe doing something different and I think that the language is for solving really problems and so if it is a good idea to make the job a bit easier here or to express things in a more convenient way than

[22:24] Before I think that is a good way and to improve the productivity for developers. So your talk is about improvements in Java 24. what are you looking forward to in the next versions? if I correctly remember not not up to date the scope value is part of the toted as far as I know which is a very interesting thing. I’m not very deep in these these tales but that looks very good to have that in a way to express things which were at the moment not very good poss or not not even possible to say it that way. there are other things like if I correctly remember the content line is not completed yet because it’s just filling up over the new few weeks but there are coming up new things like structured concurrency is another preview as far as I know because what I’ve seen so far from structured concurrency will completely change the way to handle things like that as for example completable futures and things like that was a different story and in some ways a bit hard to use or the expression or the expressionist from structured concurrency is much better than than the

[23:41] Old one with completable futures for example. So look to a lot to look forward to I think so. Yeah, definitely there is much coming up there. You should look up that on the OpenJDK things like that on the website. There is always the information what is coming up in the Japs and take a look. I can strongly recommend the people to read the Japs because there are so many information in these Japs about these how they work, what the goal was for example, what is the idea behind that or what is the idea to charge it? What kind of problem? Because if you really read that then you understand much more details about that. I think that’s very important to read that and if you don’t read it visit a talk like yours about one example. Yeah.

[24:27] Okay. That might be a possibility too or an option too. Yes. But I strongly recommend to read that because it’s a different thing like visiting a talk and see some parts of that maybe you can’t do that in 45 minutes or something and reading a compl complete jab. It takes much much longer and I always recommend to play around with these new features and just try them out. Just write some tests about that. Take a look how they work and what are you expecting? Have you really understood the problem? for example or I have coming into my mind the class fail API things like that that’s a very complicated thing but if you dig into that that’s a very interesting way to do that and I think that will some solve many problems in the future with older like ASM things like that and the dependencies for libraries from a particular JDK version or coming up with new version after the new versions are coming out and I think that’s a very good thing but you need to invest some time. Yes, invest some time. Read the Japs and then follow us on Foojay where we talk about all these things. That would be a possibility too. Yeah, because Foojay

[25:41] Has many interesting articles or inside Java has many very detailed articles about that. it took some time and also to take a look on the YouTube channel of the Java people and that is very important to do that on a regular base to get some insights how it works or what the idea behind that maybe you don’t need to use it in your current project but just to get an insight what is working on what is going in on there in the community in particular on the OpenJDK part and what is coming up in new releases and what you can expect from that. I think that’s a very important thing. K. Horsman came to JCON to give two talks. One about project Valhalla and one about project loom. Those two projects are shaping the way Java evolves and how we can write better code. He also explains how Jap’s Java enhancement proposals are used in that Java evolution process. Valhalla will certainly change the way Java works in the internals if and when it’s finally ready. Loom is ready today and it will I’m surely change the way that people write like serverside applications. they will thank their

[26:53] Stars that they no longer have to write them in that dreaded reactive style. Okay, so what are the main changes for both Wala and Loom? Well, so let’s start with Loom. Loom. Loom works. It’s there in 21. It’ll be even better in 25 because it’ll remove some annoying restrictions about the intrinsic locks. And it’s it big promise is that right now if if you have an application where you want to have high throughput where you have more incoming requests than the number of platform threads, you’re forced into a very uncomfortable programming style whose promoters tell you it’s good for you. but it actually is a pain. And so you can just write the way that you would like to write. You make a blocking call and you just block. Your virtual thread will get parked. When the answer is ready, it’ll wake up again.

[27:43] And that’s pretty much automatic. there are of course all sorts of little gotchas both real and perceived. And so what I’m doing is I’m showing how you can actually measure whether you are affected by one of them. Okay. And then project Valhalla is another project. Well, Valhalla is now I think 11 years old. And so it’s its grand scheme is to bring what’s called value types into the platform. So value type is like a primitive type today where it’s something that’s flat that’s small that can fit into a register or a few and if you have an array of them you don’t have any indirection you don’t have pointers and so soon you’ll be able to do your own value types no points or tupils or things like that. and the question there really is efficiency. And so what I’m showing is by actually looking at the bite codes the machine codes that are generated not just the bite codes because there you can’t see anything but the physical machine codes there’ll be some benchmarking some measuring of memory and you’ll really see that the performance is what they promise there’s not much syntax to it. So the

[28:48] Interesting thing is really by looking under the hood these projects are big changes but actually they are implemented and released into jeeps. those smaller improvements. Isn’t that a difficult way to manage the project or does it really make it easy to make to bring evolutions into Java? I think I mean I’ve seen situations where the Jet process didn’t really work as well as one might like like in pattern matching where I think that incremental approach was not a success. but with Loom in particular, I think it was it’s very nicely done. it there was several phases of implementations, there was a lot of input taking and still today there’s some refinements to the APIs and so there this was not rushed it’s it’s rolled out in a way that makes it I think reasonable for the community to absorb it. with La Vahala you this it’s very hard to say it’s such a huge undertaking to make such a really incredible change to the entire platform that I mean you have to at some point do it in stages and so there was a talk by Brian Guts about how they discovered after doing so many

[30:08] Iterations that by doing things in a particular order and in a particular way that a lot of the problems collapsed out and I think that they wouldn’t have figured that out if they hadn’t given themselves the time to do it in increments. how it’s going to be rolled out with the Jeeps, you know, there is now a Jeep for value types and we’ll probably see that at some point maybe in Java 26. I’m not making any promises. I’m not working for Oracle. but so I think that rollout process it’s it’s hard to do it in any other way. So I think overall we should be thankful that this thing has worked out that way. Of course it works fantastically well for kind of smaller features that you can wrap your head around. but anyway I mean I think it is amazing that Java after 30 years it’s alive and well and thriving.

[30:58] And it is getting better. so we you had mentioned those two projects. There are a lot more projects ongoing. are there a few others that you’re really looking forward to that they will arrive soon in Java? Well, the one thing that I’m personally looking forward to be in finalized is that thing that now you no longer have to write public static void main and if you write small programs then you don’t even have to have a class. Now that sounds like a silly thing, right? Because everyone uses Java for big iron projects. But the truth is I’ve been using Java as a scripting language now for several years just because you can. And I’m here to tell you that it is a better scripting language than that other sixletter language that everyone is so enamored about. for the simple reason that Java is compile timetyped. And so I find myself writing these scripts now more convenient because no longer having to write so much boiler plate. And my IDE tells me right away whether I made a stupid mistake. Whereas in that other language with those six letters, I mean I find

[31:57] Out that I did something stupid when I run the program and it does something strange. I do love also the approach that JBang has brought us that you can also include dependencies in those single file applications. I use it a lot to demo Pi4J to show how you can interact with electronics on the Raspberry Pi. I think indeed for education purposes and example purposes that the simplified syntax will make it a lot easier for a lot of people to get started with Java. Yes. an amen to JBang. that thing with the dependency management where you can simply say you know add those libraries to my project that is something that JavaS does need to have. So I was just at Java 1 and gave a talk on using Java in the small and I kind of derisively said you know how come Java has never heard of this thing called Maven Central. and afterwards Stuart Marks told me you know we are looking at this and we do need to have a solution that does something like that. So I very much look forward to AJ that will do something just to that effect because it really is an

[33:05] Important part of the picture. and another thing on the positive side actually once you do something like that it is pretty convenient whereas in other environments that should remain unnamed with six letters just try to do your dependency management. And I mean it’s madness. Yeah, I totally agree that this is one of the strong things that you can really build a project very easily in Java. Even if you go to very big projects with a lot of dependencies, there’s one central tool that allows you to do all this. Yeah. And that I think is another thing that we are so lucky that we have all all the tooling available. You know, we have fantastic ideides. I I’ve known people who say, “Oh, I’ll just do this thing in VS Code.” And I say, “Why?” Right? I mean here you have an IDE that does all sorts of things for you and I guess you could not do that but I don’t quite see the point and also you know you have people say Maven is old and uses XML but Maven is pretty amazing and on the other hand something like Jbank for programming this mall is also pretty amazing so

[34:10] There is there’s great tool support and so Java really more and more has become like my Swiss army knife for Java on Raspberry Pi was briefly mentioned in this interview with K. But Miro Wgner had a presentation at JCON where he demonstrated his Robo 4j project that extends Pi4J and controls a robot arm. He uses this project to explain Java modules. I asked him to explain what Robo 4j provides. It’s a collection of the libraries, the modules that allows you to buy to build easily some advanced robotics IoT system. I would say it’s a message passing framework very light one. It provides the training model. It allows I have a robotic hand with me. I will show it. I hope it still works on the stage. We will go through some monitoring. I know I have already burned one sero so but we will go to this how to avoid it. We have a graphana right but mainly the talk will be about the Java module system and I had to even think about it and why Java module system is important in for development of our application actually it I know it has been many time presented as a Java feature. Yeah

[35:35] That’s that’s true. Maybe that’s also the reason why many developers are trying to or hesitate to use it because it belongs to platform. The modules were a big change in the JDK. Why are they so important and what are the advantages? Well, I put it like this. The modules before I know it’s the selling point of the modules is the before we had a class. Basically there is a one fact everything what landed on the class path is a public it wouldn’t be the issue right in the fact if you use the reflection any malicious code can do the reflection over the class path but still I think if you’re selling to your manager oh did we have a class bot and oh he has no idea what he was talking about so I would put it like this so actually module system kind of guides you how to be nice to the platform form you use. It don’t necessarily have to be Raspberry Pi. It could be your containers. Actually, it guides you. It gives you the guarantee. Yeah. At the compile time and the run time that you don’t turn to the unexpected situation that not necessarily have to be illegal access exception, but it actually provides you

[36:59] The documentation. What I have experience as a consultant. So I think the companies are paying a lot of money for maintaining the software you know it’s not the yeah I mean hard right now to write just software well I mean once the code is there you have to maintain I think it’s a yeah it can become very challenging even little bit format in a way that you can deliver that product so I mean the modules should not be avoided or just by the developers stand completely against to use them because it actually something that it helps it makes the platform usage deterministic not just the class part where we have really nondeterministic behavior we’ve been witnessing this Dimmitri Chuko talked at Jacon about improving the startup and performance of your Java applications in containers I asked him about the most important takeaway from his talk. Please think about the JVM options. Don’t let other people or don’t hope that other people will tune your container for you. That just won’t happen.

[38:16] And I am an I only have experience with small applications myself. So I don’t tune anything. I just have Java jar and start the thing. But there are a lot of options I know there in the runtime. What are the most important ones that I could use for instance in Docker? At least for now, there’s one extra important option. Just see and specify the RAM percentage for your heap. Otherwise, the just default heristic won’t work well in container environments. Okay. other ones that we should know of, yeah, of course, you can choose your garbage collector, which also is related to your memory consumption and your latency. which is extremely important and extremely easy. As I said, I only have small applications. I never worried about the garbage collector. I never even thought about that there are different ones. And apparently this is a very fascinating topic, the amount of work that has gone into these garbage collectors. what’s the most important takeaway about which garbage collector to use and why to choose a different one? Yeah, of course. basically they fall into category categories pretty

[39:30] Clearly depending on the key metric that you have. So just first determine the key metric that you’re focused on and after you will be able to easily select your garbage collector and try it. Okay. there’s a lot of things going on in Java with all the small fast releases we have every six months. what is for you the most important evolution recently? I think the most important version recently is spring boot switching from all the supporting all the versions of Java to having 17 as a minimum which drives now a lot of migrations and I think that’s that’s the reality that we have yeah because if you hear people talking about yeah Java is old Java is for post they still refer to Java 8 actually yeah they may refer to I don’t know Java 1.2 two or something and you know the source of this story I think there was an article even if it’s not available anymore and it was like Java is getting oh just startup stopped selecting Java it was 2006 this article was issued 2006 okay what happened to that startups and what happened to Java yeah you need to pick your battles

[40:59] What are you looking forward to in the next versions of Java? well really many things but I think project Valhalla is the most kind of awaited thing that may bring some surprises. Yeah. What will it help developers? How will they be more productive or will it be easier coding for instance? well there are some consequences or conditions to make it happen like explicit null safety which change lives of developers. Maybe that will be a bit harder for someone to use that or to see it but that’s it was mentioned before here Cotlin has a better way of handling null safety. Is it something we should have in Java too? you know there’s always a compatibility concerns and yeah it’s just so we should see and expect what what’s happening. there’s a lot of people here at the hallway. I don’t know if you can show it. Yes. are you also one of those visitors of a conference who focuses on the hallway track? yes I am I will say. And what did you learn for instance these days?

[42:15] Oh, just meeting new people, checking some assumptions about how things work, what makes developers suffer, which is important for us. The final guest in this podcast is Yan Skinniper, Java developer at Open Value. He recently published a blog post on Foojay and he explained how he created a system to receive emails with Java. We also discussed how Java evolves to write more readable code. it was about receiving emails in Java using POP 3 or IMAP and yeah it was at some point I was giving a talk for a meet up where I actually wondered how could you test emails and then I came up with yeah you could use Gmail to do it like a mockman server. but then I struggled a lot with hey man how do I even read emails in the first place and yeah Java has like email bindings but it’s there was not really a lot of documentation how to use it properly and stuff like this and if you would find something I even say it was kind of dangerous sometimes to use because if you read emails you import data from outside and yeah it’s it’s like Maybe. Yeah, there could be something

[43:37] Insecure in the attachments. Totally. Yeah, like code injections or whatever when you put it into your database, you got to cleanse it before before you actually use it. And that’s why I thought, yeah, it’s make totally sense to write an article about it and put a focus on that one. Yeah. did you need any libraries to read mail? How good is Java basic Java in reading the mails? It’s just Java has a mail package. I think Java mail and I could just use that one. No external dependencies, nothing. Very nice. the reason that you write a blog post for Foojay is it’s to better understand the topic or to illustrate that you could actually manage it because for a lot of writers that’s I can only write a blog post if I really master the subject. Is that what was that one of the goals of this article? So I started blogging I think three or four years ago and usually my approach is when it takes really long to solve something like when I need half an hour or something to solve them something and there’s not really a lot of documentation or whatever and so now

[44:45] There’s LLMs if they are misleading as well it’s also a good point then I think oh that’s a good topic for a blog post and at that point I said okay let’s write it. I published it on my blog, personal blog. And yeah, we actually think we had like a talk with the Foojay team. They want to reach they wanted more articles be get more reach. I said, “Oh yeah, it would be good idea to cross post and it actually generated a lot of reach to be honest. I didn’t expect that.” So the article was in some newsletters then afterwards and I was kind of impressed. So that’s a message we can share with other authors if you already have your own personal blog related to Java or anything in that world. You can just cross post it on Foojay and have more reach on your own website. Yeah, totally. Yeah. So that’s one goal we have achieved. So if others want to join Foojay, they can definitely do. what other evolutions within Java are you following? because yeah there’s a lot of things happening with those fast releases. Yeah. So I think a few months ago I had to give a training at a

[46:01] Customer about modern Java like the latest Java features and at that point I had to actually research what new features were there and so like which affect the average developer. So like day-to-day use and there was actually so many nice things and I wonder so what I really like is the new switch expressions makes it really beautiful and yeah nice nice to code actually I think we have a few posts about that on Foojay is if you compare Java 8 if then else with the Q and switch approach you can achieve a much more readable and clean code. Yeah. Yeah. Totally. And it’s it was actually part of the training as well to transform an old application using the new features and yeah actually see how much better readable it is in the end. Thanks to my guests who joined for a talk in the Foojay boot. In the next episode we will look into AI and the many use cases and ways you can use it in Java development. Thank you for listening to this episode. Please subscribe to the Foojay podcast in your favorite app or on YouTube. Keep an eye on Foojay for future articles and podcasts about development and everything related

[47:17] To the Java world. See you next time. Give me the friends of OpenJDK.

Found a mistake, or something to add? Edit this page on GitHub

Written by

Cay Horstmann

Professor at PFH Private Hochschule Göttingen

Written by

Frank Delporte

Frank Delporte is a Java Champion, Java Developer, Senior Technical Writer at Azul, Blogger, Author of "Java Programming for Raspberry Pi - A Hands-On Guide to Electronics and IoT Projects", and Open-Source Contributor for Pi4J, Lottie4J, Sheetmusic4J, …

Written by

Hanno Embregts

Hanno Embregts is a Java Developer with a passion for learning, teaching and making music. In his day-to-day job as a Teacher / Technology Advocate at Info Support, Hanno prefers work that is fast-paced and versatile. This is why he juggles Java development, …

Written by

Jens Knipper

Jens is a senior software engineer working for OpenValue in Düsseldorf. He likes working in different environments, architectures and technologies. The insights he gathers are things he likes to share in through talks or blog posts.

Written by

Karl Heinz Marbaise

German Freelancer Java, Spring Boot, JUnit Jupiter, Apache Maven PMC Member @ASFMavenProject, Apache Software Foundation Member @TheASF, Mojo Haus Member, Java Developer, CI / CD Fan.

Written by

Miro Wengner

Miro is a Java Champion and Oracle ACE Pro with a career-long focus on enterprise AI, including machine learning, neural networks, and probabilistic algorithms. As a contributor to OpenJDK and Mission Control, he specializes in optimizing Java performance, …

Related posts

Join the discussion