Foojay Podcast #55: Embedded Java, Part 2
CloudCRaC

Foojay Podcast #55: Embedded Java, Part 2

As a backend developer, you may not realize that Java was initially born on embedded devices like set-top boxes and gateways. We discussed this topic for the first time almost three years ago in Foojay Podcast #2 with James Gosling, Johan Vos, Erik Costlow, and Frank Delporte.

In this episode #55, we look into the history of the Java Micro Edition and how things evolved. Nowadays, with processors becoming increasingly powerful, we can run the exact same Java runtime on any Linux system, from the biggest cloud servers to the smallest Raspberry Pi Zero.

Let’s find out what can be done with Java in the embedded world.

Video

Podcast Apps

You can listen and subscribe to the Foojay Podcast on:

Guests

Content

00:00 Introduction of the topic and guests

04:53 Java is running on more devices than we can imagine

06:18 History of Java ME

https://www.oracle.com/java/technologies/javameoverview.html
https://en.wikipedia.org/wiki/SavaJe

Jasper S20: https://vimeo.com/198239375

Jasper S20: https://www.phonescoop.com/articles/article.php?a=77&p=1498

15:55 Java on modern embedded devices

22:25 Are modern embedded devices still “embedded”?

25:24 Current modern Java is perfect for embedded uses

https://www.pi4j.com

30:10 How Java moved to ARM on Mac and cloud

34:48 Green Computing = Reducing costs

Presentation by Miro Wengner: https://www.youtube.com/watch?v=zP4xeeY3HIA
https://thenewstack.io/which-programming-languages-use-the-least-electricity/

37:47 Recent Java evolutions impacting embedded use

41:51 Is there a need for real-time Java?

LED strips with Java: https://www.pi4j.com/examples/jbang/pixelblaze_output_expander/

49:44 Spring IO presentation by DaShaun

https://2024.springio.net/sessions/spring-boot-on-the-edge

51:38 Java on RISC-V

https://riscv.org/blog/2024/04/java-21-and-22-now-available-on-risc-v-a-collaboration-between-rise-and-eclipse-adoptium

53:27 More details about the product Robert develops with Java

https://www.pi4j.com/featured-projects/soft-real-time-plc-written-in-strolch/
https://strolch.li/

59:09 Network alternatives on embedded (e.g. LoRa)

1:03:42 What will the future bring to embedded Java?

Pi4J Spring Boot: https://www.youtube.com/watch?v=I62IviQLNts
https://openjdk.org/projects/leyden/
https://openjdk.org/projects/crac/

1:09:07 Conclusion

Transcript

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

[0:00] Let’s grab some raspberry pies and have fun with Java on embedded devices welcome to the FJ podcast all your news about OpenJDK when you are a back developer you may not realize that Java was originally born on embedded devices like setup boxes and gateways there even have been specific versions of Java for embedded devices but nowadays with processors becoming more and more powerful we can run the exact same Java runtime on any Linux system from the biggest cloud servers to the smallest Raspberry Pi zero let’s find out what can be done with Java in the embedded world my first guest is Robert F Burke how do you use Java and embedded devices well in our case in our company we use them in our medical cabinets so that means we want to be able to have medical devices medical cabinets where we store drugs in a hospital on a wart where nurses then take the drugs out we want to store them electronically secure so that we can measure when and what is taken out of a cabinet and for this we use the Raspberry Pi’s I Square C bus and the one or other gpio and this is always done in a

[1:28] Way that the nurses never see anything of it it’s a server based software the cabinets are connected through a Java application that is running there with websockets to the server and so we use the py for J library and we try to keep this simple as possible but still use the full potential of the Raspberry Pi my next guest is pav Petrenko what is your history in Java I just realized I’ve been in the world of java and embedded devices for almost 20 years already so I started working at Sun Micro Systems as a part of java team back then that was the Java platform for embedded devices and mobile phones primarily then that platform evolved into a platform for embedded devices that was Java IM embedded platform primarily focusing on ples and other small embedded devices essentially that were not capable of running modern by the time voices like Windows lines and Etc that was real time OES where that could feat only the small run times and then after several startups I joined aul where I lead platform core which is distribution of open GDK I Le product

[3:05] Management for platform core and my third guest is desan Carter welcome hi my name is Deshawn I’m a spring developer Advocate I started using Java in University I think it was in 1997 and then again in 1998 I think it was right around the 1.2 release and Java was I remember the book and the story was like yeah Java’s that thing it’s going to be able to run any and they said it’s going to run on your toaster and it’s going to run on your refrigerator it’s going to run everywhere it’s amazing and the just the conversation it was exciting but my University was kind of at the front they were teaching it at University and I’m very thankful that they did I’ve been using Java as kind of a core on my career since the 90s and now I’m a spring developer Advocate and I’m passionate about raspberry pies and I work with customers that are using raspberry pies or similar devices all over the place from oil tankers to water treatment facilities to their how they handle luggage in on their production floors you know in their factories and Manufacturing so I had fun with the release of spring

[4:15] Framework six and spring boot 3.0 I got really really excited because now we can actually take my spring Boot and those kind of workloads and I can deliver them to these small affordable computers and do lots of really interesting things so thanks for having me on the show I’m Jazz to be here what pleasure and I’m Frank I’m doing Java development for over 10 years I started experimenting with Java on the raspberry pi over four years ago there’s even a book I wrote about it and it eventually landed me a job at aul so no colleague of Pavo yes so Java unembedded I’m happy to hear from you desan that it’s running on so many environments Robert is running it on medical cabinets so I guess we can say that although people know Java as the system running on big big big servers in the cloud on your desktop machine but there is more Java out there than we realize I think I agree 100% one of the interesting things about being in this role is getting to talk to customers all over the globe and hearing their unique use cases for where they’re using it and sometimes right the default it used

[5:32] To be that oh computers are cheap and we’ve got a Data Center and dis is cheap and all those things well now those pennies that you save for that thing that might be just controlling a medical cabinet right it doesn’t need to be a data center rack and have you know 15 levels of backup and redundancy maybe what you need is something that is small and affordable and can be easily replaced so these use cases and these different vectors that we have to decide where we’re going to run our workloads those have now become a differentiator those have become a critical component of how our business survives because we know that survival isn’t mandatory and it’s these little changes that we can make that might make the difference B so you mentioned you were you have a long history in Sun Oracle in the Java development actually so you were part of the team that developed that Java micro edition how was it different to the OpenJDK or the Java runtime that we use on our PC so I think it makes sense for us to dive into the history and remind ourselves what this devices looked like

[6:47] Back then now we used to this modern Apple devices Google devices and other vendors devices which run full-fledged opting system with Native application model with app app stores and application marketplaces Etc back then there was like these Dum devices that could just call that had like physical buttons really small screens like I know 32 by 48 pixel screens with really limited capabilities U initially it was prob just calculator and as devices evolved there was a demand for having something something else on top of that like first thing was games for sure and if you think about what needs to be done in order to deliver gaming like custom games not pre-installed games because there were tons of pre-installed games like worms and yeah like yes snakes cards Etc like that we all pre know very well so people needed to install something on top so essentially what’s needed was some platform that deliver connectivity Security application management some multimedia capabilities and all that and that’s that’s where this demand and that’s where this Java platform came with

[8:22] If you think about this devices they only had in the best is hundreds of kilobytes of Ram compared to gigabytes today and only megabytes of storage space where you could install something and where applications could could D their intermediate data etc etc and that’s what Jai if I’m not mistaken Jai was announced in 1999 as a platform by some Micro Systems the way it worked it was a replacement for an operating system syst it was playing role of operating system it managed applications managed processes managed resources connections etc etc like everything and that’s where some Micro Systems made this great step to standardize it so that all the vendors can start implementing and installing and using these Java platforms and start providing ways to run Java applications and that was one of the one of the game changers back then so you can you could now download your own applications you could run something some custom things and you could even Implement some basic applications and run it run run them on your phone I

[9:48] Remember when running my first J Java application on my phone that was very different feeling like that it was I remember so first of all I’m going to say thank you in 1999 I think that I had my first generation phone and I was moving into the real world I was moving into the do com boom it’s what we call it in the US where like everything is going to the web and everybody’s doing all these things and I found myself Consulting and needing to upgrade my phone right so I went out and I was like well of course I wanted to run Java and I remember finding an I think it was a Nokia phone that was running Java and me and I remember thinking oh well not I have this phone now I got to build something on it and we only had like 12 characters across or something like that and like four lines of text so there wasn’t much there but the idea was hey I wanted a frontend system I wanted the thing for the people that working in the retail side of the store to be able to call back to storage to you know the pack and Pick and Pack back in something that they could do on their

[11:00] Phone like I need one of product A9 so it was just kind of a the code ended up being there was a format for it for like hey we have different pages of views but it was very similar to the stuff I was writing with batch files back in the early 90s on my PC it was just like hey here’s a screen here’s the menu I had a select and then okay and return but my mind was still blown that I had all of this amazing cool little power on my tiny little Nokia phone and yeah I I’d already bought into Java at that point but that just kind of like solidified the value and the road map that was set for Java that it was really it was going to go places where we didn’t think that we could go as easily as we could Java opened the door to a lot of different things and that’s just one of them and it’s not only that Nokia phone but we found a video of this J Jasper s20 which shows a UI where you can scroll through I just watched the video through through pictures like how was this even possible at that time with I lately heard the comparison that nowadays a phone has 100 times the power that was needed to

[12:13] Put the first man on the moon the whole computer system at that time now a phone is 100,000 times more powerful but if you go back to yeah 90s how was it achieved to now the Java that we have which is if you install Java is now 200 300 megabytes what happened in between or what was so special of that version of java that it could run on such a small device yeah if you also remember about the battery life of those phones back then it was days sometimes weeks right so there are several reasons why Java was success one of them is securi Java was designed to be focused on security in terms of like endtoend security service to H device connectivity it implemented the latest standards of encryption etc etc also robustness robustness and security from developer point of view at that times C C++ assembly were the most popular languages and if you start thinking about the major problems of those languages it’s Resource Management memory management primarily you could write you could read from almost everywhere which results in blue screens which is unacceptable in the

[13:42] Mobile world right because it crashes it impacts your applications by the way another thing which I just recalled it’s multiprocessing meaning that you can you could run multiple applications simultaneously even though like physically it was one single native process but on the at application Level that was considered to be M multi-threaded environment already and you could run multiple U multiple applications that pre preempted and allowed for execution of parallel user threats and the system system threats that managed all the connectivity and all the system all the system stuff application portability that was this the main thing you write it once and you run it everywhere you run it on your refridge you run it on your printer and on your mobile device which never happened that was my but for a number of reasons and we can dive deep into that application size so Java B code if you think is almost an order of magnitude smaller than AG code and back then when we had really really slow connectivities and speeds of this wireless networks that

[15:14] Was critical seven times approximately the ratio I think of bite code to the native compiled code is approximately seven seven times and finally application management no other platforms had this way to auto update applications manage sources of applications launch them etc etc manage multiple applications running at the same time Etc that was all new so that’s what all this was proposed to this world and a lot of this was different from what Java had in the desktops and server platforms let me take a big jump so we are now on that systems now if you go to nowadays Raspberry Pi and other equal boards like beagle boards and stuff like that they are really powerful they have the latest arm processors they have two four8 gigs of memory and I think that’s also how you use them Robert they have these extra physical pins that allow you to interact with sensors with output devices is that maybe the biggest advantage of why you use these these raspberry pies for instance let me back up to the to also a bit of a history part I mean you guys were

[16:39] Talking about all these embedded devices and I started my Java career in a different segment it was server based but it was already we’re doing realtime solution platform for shop floor Logistics so there were plc’s from seens that did all the hardcore time management of conveyors Etc but they still needed some higher level application for managing Which con which box goes where and this is what where I came from and where I started my career on that was really interesting because if you talked with other people especially those days when I did when I was still at school and stuff then people say but Java’s too slow for that kind of stuff this business processing especially in the situation where people really stayed in their old days of everything needs to be in a relational database we already then in those days we were completely in memory only so we would come just read the whole database out into memory at startup and then keep all decision based decisions in memory which would allowed us to be really quickly to decide which box needs to go where and it was way more powerful

[17:54] That actually needed in a Java based system where we had high security we didn’t have memory problems we didn’t had out of bounds exceptions all that stuff that was pled in a c C++ environment and that’s what we loved we could just really get down to business and well that’s where I started off but guess now today so what I said before is in medical cabinets we use the Raspberry Pi for the i squ c bus but we also do something completely different where we actually now have gone so far as to build our own plc on the Rasberry Pi that means we’ve bought some very simple iio expansion boards that we then also use it through iqu C and we can now do the complete thing we did which used to be Seaman plc’s costing a fortune we can now do in Raspberry Pi with Native Java code writing in the same language on the server as in the PLC and keeping us really focused on what we want to do and this has really allowed us to then yeah control conveyors real time based well I mean real time in a soft thing it’s not a real real time but it’s more than adequate and our customers are really happy with what we offer in

[19:15] This situation and that’s something that really gives us a great value for in Java and with the Rasberry Pi so you have commodity Hardware doing really Enterprise grade applic ations we have easily replaceable components when it needs to be but actually Raspberry Pi so stable and so well built that they never break anyway unless you do really weird stuff so yeah that’s that’s really an interesting part and what we really love is to be able to stay in our language use the same domain specific languages and then you can really stay yeah keep keep work going on without switching languages or whatever and yeah run what right once Run Anywhere it still applies to today yeah there’s a few things there that you touched on the ease of access to commodity Parts components right they weren’t always designed for raspberry pies but now you can see that Raspberry Pi is kind of influenced you’re you’re finding more hats that are suit yeah built to fit raspberry pies and competitive boards that are fit built to fit where raspberry pies fit also in my

[20:36] Journey I noticed when Raspberry Pi started offering commercial support they I think this is in 2020 when it became official like they had a fully commercial licensed approach so like hey yeah this is the customers that are going to get the access you know when Supply you know Supply chains have issues this is how you can get that commercial access so you can actually build your business on top of this Raspberry Pi platform so that was the first thing that definitely has changed the other thing that you talked about is Java being able to Now command and interface with all these other things that was a big shift and I’ve worked with customers that were like yeah we were using these other boards these other components and we are having to do this other language this other approach and yeah when person all of that goes with them now that we can use Java for our Erp systems and all of our e-commerce systems and I can use that same expertise to control these devices that we’re putting out into the world at our customer sites this has completely change the game for some of

[21:46] These customers that I’ve been working with they have the ability to kind of raise the entire organization by their investments in Java and the Java ecosystem because they’re using it across their entire organization and they get those benefits especially when you think about also being a web based applications even the PLC we just we write a simple web- based UI to look at all the controls and to do maintenance and diagnosis Etc and the same stack is on the server for the Erp based web web solution and that really makes it so much easier to onboard new developers is the title of my of this podcast episode maybe wrong wrong are these really embedded devices this Raspberry p question yeah it depends where you put them right yeah wor about them I have a colleague who probably debate it and say this is not an embedded system but then again they have become so powerful that they are not they are actual PCS more powerful in the PCS that I was learning on right like what my kids have is yeah hands down more powerful than what I was learning and I was doing

[23:00] Really interesting things I was hosting websites on one U commodity servers and today if I were to do it again yeah I could have a I could replace all of those servers that I had in 2008 those you know one CPU one U servers I could replace all those with raspberry pies and I would be fine my infrastructure would be just fine I could literally do a one for one replacement and yeah things would maybe perform better at this point so yeah that has changed but now these the other interesting thing is like hey are they embedded we can put these devices into really unique situations that we couldn’t do with a oneu server with the commodity Hardware desktop level or yeah Data Center Grade equipment these devices are going into interesting places and they are becoming a part of bigger systems on vehicles on control towers of manufacturing floors and I this medical cabinet case where it is kind of that one and then you kind of describe there’s another part of the system that is keeping of those there’s I want to know more about that but yeah is it embedded yes I think it is

[24:12] And I think that yeah the definitions we can argue about definitions we could do that all day but it’s it it’s interesting in that it changes the Paradigm of where we normally see Java going right Java’s been around for a long time and yeah when we think about it the other I guess part was like the real time this the Speed and Performance of having everything in memory those were massive advantages again my background coming into the doom boom hearing about what aul is doing with the JVM and how much memory they were able to provide to the JVM those types of systems that needed that speed those the millisecond latency and they were able to do it within the JVM that was a differentiator especially in the financial services that it just changed the game and knowing that hey there there’s a possibility it changed the way yeah people were thinking about their systems and they didn’t have to worry about the arrays you know running out of memory and having to do all that collection they could focus on their core logic they could focus on the differentiated yeah aspects of their business and

[25:23] They could go fast so we had this Java me which was focused on this the small devices which was correct at the time do we see now that we have these more more powerful boards and we can just choose the Java the same Java the same runtime that we’re using on our PC can just as well run on these these boards that’s right and I think that’s what Robert mentioned so one of the key driver of for Java there on these devices not only on this devices on the embedded devices today is the platform and code unification if you have to support multiple Hardware platforms I can imagine having medical cabinets having multiple revisions and they could evolve from 32 bit platforms to whatever like latest revisions of Raspberry Pi Hardware which is like pretty comparable with some server B server server side Hardware and you still want to maintain the S the simil the similar Source base which runs everywhere like across all these devices meaning the same level of java version the same level of features available to customers and users I think Java is one of the one

[26:50] Of the solutions there because it’s available across all this range of devices there yeah in our case with the medical cabinet I mean we pretty soon decided on the Raspberry Pi we did do first experiment or of thought proof of concepts with the Beagle bone black what it was called back then somehow we land with the Raspberry Pi I think it had a bit more to do with the community being a bit better at the time getting quicker onboarding of and running a Java application and that is a big part of everything I mean the Raspberry Pi Community is phenomenal the amount of documentation that’s out there has just gotten better and which is why we’ve always been on the Raspberry Pi but we did start out on the 32-bit OS and then we moved to the 64-bit version quickly quite soon as we just wanted to say on the same version as on the server as we saw it didn’t really matter and the Raspberry Pi actually offered or the JVM 64bit offered a better performance with the 64-bit than the 32bit JVM and that was that actually led to some race conditions with the IC I2 I Square C

[28:08] Bus which we had to some bug we had to iron out but yeah so it was still the same codes and just a bit of testing and then we saw that everything just worked fine and that’s always been the case now with all the updates from Rasberry 3 four and another five where well we need some new drivers on the pi4 for JS side but otherwise everything just works mhm out of my curiosity did you guys when you when you’ve chosen the hardware platform for this devices what other languages Technologies did you consider and one why did you ended up using Java basically there was never a question of using a different language than Java as our server side was always Java and we knew that it was possible to run Java on such a device device especially when we looked at the time when we started building our cabinets there were already a few such devices coming out where you could run a normal Linux system and the JVM was available thanks to the RM 32-bit Environ architecture so this was why we quickly didn’t even think about using a different language and we also knew that we just wanted to actually

[29:25] Communicate with the server in a with websockets in this case now is what we decided and we wanted to use the I Square C bus as in our case this was the bus that we decided was the most efficient for our Solutions we could have used any other bus of course SPI or serial interfaces but we did have pcbs that we designed ourselves and in this case our Electronics developer decided that this was the way to go and as we saw that we could communicate at thanks to the wiring pi and the beginnings of the Pi4J status we could use this we decided that was the way to go as again the community was there without maybe exposing Brands brand names that you cannot cannnot name but I know the Java is running in a lot of devices that people don’t expect I know that there are a few Java licenses in my car here in front of the door because it’s used in the in inment system for instance are there other unexpected use cases you can talk about you already mentioned ships I think the Shan things that I can say on the boards wise the boards Ras Ray Pi kind of like

[30:45] Started it and then you found these other boards that were kind of custom built or purpose built like some boards had better video processing some board had more USB ports or yeah you were running into limitations on your use cases so we saw like hey there’s some room in the market to build a competitive board similar processor similar a I can use the similar operating system and I can it’s worth it for my business to go in that direction but then the ability of java to be able to move across these different platforms with relative ease I thought in the Raspberry Pi first and then when we started seeing arm 64 being available in the cloud then because it was Java the Java workloads were the first ones that were able to switch or run side by side and say hey hey you know what hey this arm 64 single thread per core approach it actually works better I Was Not only was I saving up a little money by switching the architecture I was finding out that the way that my system works I was actually performing better on that arm64 AR arure for reasons again it’s another

[31:59] One of those vectors where we get to decide you know whether I want hyperthreading is going to perform better for this workload or that single thread per core is going to work better for this workload but now I have a decision and I can use Java and I can switch back and forth I can do the experiment and I can decide do I want to save a million dollars this year and it’s as easy as that a lot of the other languages Frameworks they didn’t have that ability to make those types of moves so the promise came in the ’90s right once run anywhere and now we’re seeing it really in fruition across platforms across clouds across different types of infrastructure where we can make a decision based on the market based on our workload the right answer the right answer changes over time and Java allows us to change over time without changing our language that’s actually a point I was not considering so am I right to say that Java on arm was first there on embedded and then came to the Mac came to the cloud yeah okay right so I started working on this build pack that I was doing it for my

[33:08] Raspberry pie workloads we had the ability with gr VM to do the native image that I could run on the $15 Raspberry Pi 2 it had the four core arm 64 and that was exciting but I was doing this as like a project for the stuff that my kids are running in the house so I could fit these I’m a spring boot guy I wanted to have the Enterprise gr you know production ready things that had actuator end points but on these $15 devices that was the goal and I was able to do it I was able to replace the python projects that I was Finding online for all the other Raspberry Pi cool things I was able to replace those with these spring and Java on these small devices but then the M1 came out I’ve been doing this thing for a while the M1 came out and then all of a sudden the community is like hey your build pack doesn’t work on the M1 I was like oh I wasn’t I wasn’t expecting it to go there I wasn’t even thinking about we had arm 64 in the cloud already I’m thinking of I think it was 2021 when the M1 came out or early 2022 and now that I’m I have these Bill packs that are working with at that time was called

[34:14] Spring native and I had a community that was starting like hey we need that too can you give us the new release we want the latest Java version can you help us and it became important that change became important and then even a friend called up and said hey can we use that bill pack with Zulu yes and this is yeah where we are it definitely started on the raspberry pies for me and then the cloud came the cloud Amper VMS that were available and then canm once so what a journey what a journey and I’m gonna add a link to the shows of this podcast to a presentation of Meo Wagner he compared the Energy Efficiency of java versus python and other languages where it shows that Java is way more energy efficient and the same goes for U the processor the arm processor is way more energy efficient than than other processor so that’s nowadays also a very hot topic I heard that the topic of Green Computing like when we start talking about the native images but even just arm 64 I always say like it running on arm for it’s like driving a Tesla it’s just better for the environment like hey it’s it’s the thing

[35:35] You make that change if you can make the adjustment there’s business reasons to do it but if you can make the adjustment you’re saving the environment I replaced my data center right where I had a lot of racks like sitting behind Robert I had a few of those under the stairs in my basement and it was running at 1.5 kwatt hours at idle like just having my racks turned on 1.5 kwatt hours and I was like oh this is crazy so fast forward I replaced all those racks I now I’ve got quite a few of these raspberry pies but I can do really interesting things with those I can have them sleep I can send a signal to the pie sugar that says Hey I want you to wake up this device get some some data from it and then I want to sleep for five hours so I’ve got a lot of flexibility and these things are consuming a fraction right even the hundreds of them that are deployed in my house they’re still consuming a fraction of what my one rack of you know Dell r710 was consuming and you are pointing out that it’s the green Factor Green Computing but actually if you do this you also save money so it is good for your

[36:41] Business absolutely you have less less energy devices as as such are also cheaper I think so in the end it’s also a business advances that you make there yeah so the presentation that you’re you’re referring to I know that there was a new stack blog post that kind of ranked all the languages and it was like C and C+ Plus for you know up the top and then it was Java like it was like two times or half the efficiency of c and then like at 18 was Python and like typescript was way down like but it had these rankings but that blog post came out in like 2018 that we can do Java on the jbm today I’m curious with all the other advancements that have happened in the Java ecosystem especially around the jbm I’m wondering what that would look like today I would I’m very curious to see what that relationship will I guarantee it’s closer because of all the advancments in the jbm which is a good topic to come back to so indeed Java is evolving every six months we have a new version Within These versions of the last years did CHS change that have an impact on how Java runs on smaller

[38:04] Computers virtual threads virtual threads yep 21 virtual threads absolutely changed the performance metrics that’s a that’s a blog post in itself like I can take some of these you know toy projects that we’re running on maybe we’ll say the $15 Raspberry Pi 02 as the Baseline and there’s this you know that x z hack that happened to while it was somebody that was like oh that command there was a tiny little it felt like it took a little bit longer like what’s going on after they did the update and that’s how it was identified and you know when you’re doing things you see it long enough you expect like oh here’s the timing so I don’t I didn’t measure but that timing of the things as they started up and as they were running on these little devices I absolutely noticed that how much snap it was when I enabled virtual threads and I put these on these small embedded devices it was to me as a person it was visibly noticeable Al you’re really involved in the whole development of java the language and the runtime do you see projects finished projects but also

[39:15] Upcoming projects which will have an impact on how Java is used on embedded in small computers before we answer this question we should probably Define what this small and embedded devices and computers are one of the things that I personally see and that may be a separate project is support like full fresh Supply support for 32bit configurations in Java 21 plus because out of the box there is no support for example for arm32 in open that’s something to build this vendors need to do some Chang and that’s probably one of the project one of the and what would be the advantage of going back to 32 bits it’s it’s not that we going back to 32 bit it’s that we clearly see a need for people to upgrade their Java requirements to have similar Source base similar level of supported features even though they don’t necessarily use all this new taxi features on these small embedded devices but the fact that they have to maintain Only One S Source base is a big deal for some customers and the use case could be anything like from infotainment to whatever like

[40:51] Terminals banking terminals or vending machines or stuff like that so that’s what people where people that’s a typical use of java that we see and they just need need to run it like across across their Fleet devices otherwise they have to pay separate teams to maintain and Evol The Source bases which is way more expensive for them to just upgrade it once and then keep it keep it alive yeah that’s that’s I think the major major thing that I have on top of my mind in general I think there will always be a space for the small embedded devices however as we get more and more powerful devices I think more and more standard Java distributions we we’ll just run this embedded embedded embedded in the embedded use cases one thing to mention and that’s what probably had had a question to you guys so the limitation today for all the Java and all this embedded embedded use cases is non realtime use case and desan you mentioned realtime processing earlier today by unreal time I mean everything like infotainment it could be some infotainment in the cars it could

[42:19] Be infotainment even on the planes we’ve seen Java used on the plan through specific Rend cles but did you guys have any experience with hard real time requirements when there is certain response time requirements that you had to meet in your applications in the better use cases where you tried you had to use Java and how you work this wrong I have one fun example and that’s controlling lead strips which is a challenge in Java that is very true that’s the only use case I go back to a microcontroller because it really needs strict timing that’s the only time I found it difficult and something was not achievable there are also a few sensors like the one wire temperature sensors these are very hard to read out with Java but I don’t know if these are real use cases what jav un embedded so maybe Robert the Sean you have more experience with these kind of requirements so what I can certainly say is that for our Pi4J Library we definitely always have the problem that some devices they really do need a realtime communication with them so they really expect a packet to arrive

[43:48] In a certain amount of time over whatever interface it is and I mean we’ve seen this now as you said with the lead strips or temperatures so one wire communication can be such a situation and everything this is something that I’ve also been thinking in my company where I work where soft our PLC that we’ve got where we can control the conveyor so we have a sensor that says the con the a box is there and now we have to close a gate or something and we have the same situation in our situation the Raspberry Pi is fast enough to handle this where I don’t know 50 milliseconds is more than enough and you just add a bit of timing in there and then usually that’s fine but for something like the like like a lead strip where the pack needs to come in 50 micros seconds you always have a big problem and there the question is of course not the JVM but rather the operating system itself which can guarantee us this hard real time and there yeah so I’m sure that I mean the Linux Cel is soon going to have the realtime code Mainline so we might have a possibility to do more realtime

[45:12] Testing soon without a lot of Kernel hacking who knows maybe our problems will be solved then that was the big hurdle for situations that I was in is like the you can do lots of amazing things Java’s fast but it really was reliant on the operating system that we were running so the one use case has in my mind is with drones like hey I’m I’m a Java developer I want to control these eight propellers with Java but in order to do that underlying operating system yeah it couldn’t give you all of the guarantees that you needed for a device like that hence we’re we’re using these microcontrollers so now it’s like hey can I take my Java B code and deliver and I’ve been asked this hundreds of times like is there an easy way when are we going to be able to do you know Java on a microcontroller and I know that there’s there’s people that have done it and they’ve done amazing magic I just I’ve not done that demo yet but yeah we’re it continues to move forward and that has been kind of the bottom line is like that hurdle of the operating system which I know it’s an

[46:18] We’re in such a lucky time right now that all of these things they’re like oh yeah that’s a limitation that’s going to be while and yeah you stick around long enough these things get resolved there are people that are working on those problems and they are yeah we get to benefit from them you either throw throw out a little bit more powerful Hardware or you just switch to Native for certain real time and like sort of hard real time tasks and then address this one you makes sense I’m always reminded early 2000s data centers was a big deal like you could make a business just of I can build the data center faster or better and I can put in all those requirements that you need for your security Etc and the data centers that were in Wall Street in order to not give away advantages to anybody that’s closer to the network every computer had the same length of networking cable whether it was right next to the switch or on the other side of the room they all had the same length because they couldn’t give an advantage to the rack that’s right next to the switch

[47:27] Versus the other ones they for Wall Street and for the financial industry that extra fraction of a millisecond was the difference so unless your facility had that so yeah we’re we’re coming a long way these are the types of things those milliseconds matter I like to say that latency is the new downtime for a lot of these use cases but even that latency that you save for the financial markets aul has a solution because I think the top 10 companies are using it so yeah there are differences in what is real time if you look at trades being happening that’s in milliseconds if you look at Electronics then it’s even faster and those are I think two different different use cases and because all these microc controls are also so cheap I think I solved my let strip challenge with a little serial device that I could control through yava and that little device is then controlling the electronics which really needs the strict timing there are solutions and nowadays they’re all very cheap luckily which allows us to experiment a lot okay I was say one of my customers they’re use cases they’re they’re dealing with

[48:45] Oil and pumps and switches and all that kind of stuff and they’re they’re measuring it on this cubic millimeter of oil like each drop of oil matters and that’s the level of accuracy millimet centimet something but like ridiculous for oil that they need to get this level of granularity for their pumps or whatever it is this is an amazing time and it’s those differences that we can do now that we couldn’t do 10 years ago that those are the ones that are make a difference going forward so basically there are certain applications where Java will never be used today which is self driving car applications for example or avionics on the planes etc etc where hard real time is required but in most other cases Java is pretty pretty useful the sh you were in Barcelona I think a few weeks ago for spring iio you even had a talk there about spring boot on the edge can you share what your talk was about the main point is the number of devices that are being deployed the iot devices I think the metric was like 24 billion by the end of this year are

[50:10] Going to be deployed iot connected devices and what I was trying to explain is like Java is running in these devices more than you think so whether they’re in the telephone poles or you know my kids rooms right the number of devices that are running Java and they connected that is definitely trending in this direction and now we have the ability where we’re running spring boot on these devices and we can do it easily and we have tons of options with the JVM with the native images and then also right the different types of chips it with Java I can still run on other processor if there’s a JVM there right the next one right the next hurdle for me is the risk V and running workloads on these similarly affordable devices very different architecture but with Java I can still go there right and as we get that differentiation there’s going to be more and more use cases we’re still kind of yeah it’s still like a new age of all the things that we can do on these little devices and they’re going to be everywhere so my journey was really just about like hey you can do it and maybe

[51:21] You do have a use case where you could have a differentiator by delivering a small device that might be connected to other small devices but running Java workloads and giving you all the benefits of java across your organization and across the globe you mentioned risk F what is that that’s a new type of processor this is a new type of process an open- Source architecture so arm is a there’s a Consortium behind it you have to license that their yeah their architecture you have to license it risk V is fully open so it’s it’s still it’s not as performant but because it’s open anybody can go and develop a risk V processor you go print off your own silicon and you’re you’re okay and there’s no additional licensing so a $15 computer becomes a $7 computer with a risk V processor so same everything else but because of the licensing for that processor is not included yeah it becomes more affordable and yeah and soon you know we’ll see I don’t know if it’ll ever make it to the cloud or to the data center but I also think that there’s going to

[52:34] Be more workloads being deployed outside of the data center and the traditional the cloud environments I think there’s going to be more workloads being deployed outside of those environments than ever right that are than the ones that are being deploying to the data centers in the clouds so yeah it it’s a tradeoff we have Java for this risk fee we do yeah we do and we also have a I’ve not taken it there yet I’ve got my stash of risk B processors you know Raspberry Pi like boards and I also have a promise from the grvm team that I can deliver native images to these risk V so there’s there’s some room there but yes we do have versions of Java that are running on these risk B wordss okay I need a few more test devices to put on my table there yes yeah Robert can you give us a bit more detail of the devices that you’re building so these medical cabinets and how they interact with how people use them and what the software is doing there right so our cabinets they are built in a way that it’s a standard cabinet the first version was a wooden cabinet with drawers that had a lock at

[53:53] The back where if someone wanted to open it they would have to first select their the patient for which they want to take something out of the cabinet they would then select the drugs that a doctor a physician prescribed and then they would say check out and then the relevant drawers would open so the total cabinet would be locked before anything could be done and then when the lock would unlock an LED on the front of the drawer the right drawer would then light up and that would the nurses would know in which drawer they the drug is that they want to take out they would then open the drawer while opening the drawer the pcbs inside the drawer would activate an infrared net that would watch all the slots in the drawer so we would have up to eight Lanes of drawers which would have plastic insets where the drugs would lie inside and we would then know virtually which slot is how big so we would then light up one two or up to six lanes and when someone put their hand in then we with the infrared we would detect the nurse put their hand in which

[55:29] Slot so this would help us to see that the nurse actually put their hand in the right slot and only then the process would be able to continue and the other thing is next to the infrared light we would also have a normal RGB light so that we could light up the right slot and this so it was also made in a way built in a way that we could very easily take out a whole Lane of infrared lights and double the size of a slot in the xaxis the y- axis would always be the same size and there you could put in little plastic dividers dividing up slot and then in the software would easily just click it and you would make a slot larger or smaller and then this would then this information was always on the server and be pushed down to the cabinet and what made us what made us very practical is that the cabinet is very simple it doesn’t have any information about patients or drugs or whatever you would just know I have these slots I would have a name on it whatever that might be more be interesting for maintenance but not anything else and the will complet completely be controlled by the server

[56:53] In real time so the nurse would of course just communicate with the server and the server would know with which cabinets to communicate and we then extended this actually to go even further that we built our cabinets to do this and these would be fully have electronics and everything with all the checking of putting the hands in and everything but would also be able to add simple locks for the already existing cabinets that they might have in a in a medical W so then they could just put in a lock there so the house the hospitals inhouse people would then go and build in this the lock in a way that they would like it we would just have a cable run to our existing cabinet that we would have there and then we could have additional El electronically locked cabinets and this allowed hospital to buy very little or as much Hardware as they wanted from us still use existing stuff and we could actually fully control the logistics of drugs on a Ward and this is very important not because we want to see what drugs get stolen and stuff like that but actually

[58:18] To measure what happens so first of all the cabinet would always know how much is of a product is in the drawer because they would say how much they take out of course if they enter the wrong value then stuff happens but then again it’s still much better than what they had before because they wouldn’t know where the drug is they would order often too much etc etc and we always only had the drugs on the C in the cabinet that were really also prescribed by a physician so people wouldn’t have to people usually would order too many drugs because they didn’t know if a physician would need would prescribe like over the weekend and stuff like that so that could reduce the amount of stock on a w so this is stuff that is the logistics or is our company’s IP but then again for the hardware side it’s it’s always been very important to get this working together in a simple transparent way and we’ve now gone further and we build our own movable cabinets so these are these were existing cabinets that we put in the in a Ward and they don’t move anymore but now we’ve gone further and

[59:31] We’ve actually put them into movable cabinets which the nurses would take with them to the patient’s bed and now they could do further work they could actually then take before they go on tour they could check okay I’ve got these five patients that I’m going to visit today check their small little cabinet that they’re moving around the trolley do I have everything know okay then communicate with the main cabinet fill up the trolley walk to the patient and thus walk less around which is an very important fact of nurses we want to keep them mer nursing and not running around after administrative stuff and yeah so that’s that’s one of the further thing Parts we’re going and here we’ve got the exact same technology the exact same stack we built bit different pcbs because of size constraints Etc but we’re still using the raspberry pi we’re still using our same Java code and now we’re just being wirelessly connected to the in-house Wi-Fi before we were using ethernet but still for the P for the nurses it’s the same situation they can still use the same software they just have a bit additional

[1:00:53] Uis to handle trolleys and not just Awards stock Etc that’s the first mention of Wi-Fi right this is another topic is that these devices Wi-Fi isn’t always within range right being able to access some of these other protocols the low raw for example where we have kind of different use cases we don’t need the you know gigabits per second but we need to get that information we need to get it and maybe it’s again I’ll use that the oil tanker that’s 20 km offshore we have other ways that we can deliver that data how do we hold on to data like if if I don’t have any connectivity how do I store that data on a device and then when the connectivity arrives then I can send it or how do I summarize the important bits of information instead of sending thousands of lines of a log from the system how do I sumarize that information send a smaller packet in another way but that whole segment that you just want it blows my mind this is a great example of how we can have these sensors closer to the data the actual data and deliver things it’s one of those small changes

[1:02:07] That we can do so that we’re not spending too much buying too much letting stuff sit on the shelf and that goes beyond just medical right that goes to all the other Industries where we’re buying stuff from our supply chain so thank you for that was what I wanted to hear you got my wheels turning there’s a pictures of those cabinets on the Pi4J website so I will also add a link to the show go take a look and I’m happy to give you even more info if you want to the I’m always interested I’m GNA buing you now it’s recorded said it watch watch out with Robert desan he built his own version of a spring system so he has a competing you on that I don’t I don’t use spring that’s all right but I’m not against it not everyone can be [Laughter] perfect no I also like your solution because it’s really they always say software should be easy people should just do not need the training to use software and the same with your cabinet it’s just by opening the right drawer and lights turning green and red that people are guided in to that system without having to learn a lot of stuff

[1:03:28] And those Solutions and with nowadays electronics and the price of these components building such such a prototype is also become very easy and affordable maybe a last question to conclude what will the future bring to Java for embedded or these small computers or what is the future looking like faster more secure smaller or at least adjustable bone size the work that’s been done in Spring boot even though I don’t use it is really really good because to you get more people be able to actually think about using the JVM for their applications and having spring Boot and now with Pi4J Library being integrated into this you can really get on board new developers and people will on new developers will have new ideas and then be become creative especially when they come fresh from college or whatever School they’ve been doing or even at the college and school where they actually learning Java and trying out things that this will really create create a new dimension of what will be done with the JVM I mean thinking about all these people doing stuff with lead

[1:04:52] Strips on clothing and stuff and then who knows I probably would be doing that soon the spring boot instead of using C or whatever you know and maybe people who will start using less python for this because it’s now thanks to all these other additions making onboarding of new Java developers so easy without having to have a main class and explaining all that and just writing a simple Java file and running it and all the optimizations getting this the JVM to start quicker etc etc that there’s no need to go back to the python language which as we’ve seen is not as green as Java is whatever measurement that is so this is really going to make it so much more interesting and keep people to on this language and not which will be then the right language for further Business Development I mean people will either def decide between the JVM or net Etc but probably one day it will go away from python because you need something a bit more scalable and a bit more enterpris I think and at least that’s my feeling yeah this the spring team the Java team one of the Core Concepts we’ve been

[1:06:03] Talking about runtime efficiencies one of the demos that my son is actually going to deliver later today is that we take our code that ran on Java 8 and then we switch it to Java 21 and the amount of memory that it takes is significantly less like 40 or 50% less just by switching to the new jbm this goes back to the 32-bit conversation if I can have the same infrastructure if I can have the same devices you know Machinery Etc that I’ve been using we can still deploy and run the Java 1.0 code that we created back in the 90s I could still be using the same Linux 1.0 that came but we probably don’t want to do that we want to get all the benefits the security the performance it’d be great to be able to have that same infrastructure in place wherever it’s running and be able to just upgrade in place that would be wonderful so there’s definitely a need for that 32 bit of approach my mind is I’m on the same page with you Pao but this runtime efficiency is going to open the door it’s going to make it easier and I’m going to shout out to the Pi4J spring boot starter is going to

[1:07:06] Make it easy for the whole you know there’s a few million spring developers that I think also like raspberry pies and are interested in some of the cool things that they can do outside of the data center I think we’re trending in the right direction and I think we’re just getting started I think the momentum is building and it’s a conversations like that’s that I think are going to help it right so if we talking about or thinking about runtime sufficiency and Java there are three main problems in Java to solve first is startup time it’s runtime performance of throughput and it’s latencies latencies and predictability of the Java Java execution and there are projects in open G in as as as the evolution of future Java like Laden or crack for managing the startup time and there are various approaches to managing and improve runtime performance like various optimizations and compilation techniques and compilers and there are some approach is to manage latencies that U Frank managed ear today yeah so I think that’s that’s all probably be the

[1:08:36] Future and the bright future of java unembedded and not only on bu devices because yeah we’re talking about this pretty shady line between the enterprise Enterprise and embedded huse cers today so and because we can use the same Java on all devices the same runtime different distributions but they are available we can benefit on all fronts of all these improvements okay thanks a lot for your time thanks a lot for joining this podcast recording the Java the Pi4J spring boot starter that we mentioned that will be available soon we’re working on that Sean and I will bring hopefully also a bit more yeah Electronics lovers into Java and vice versa we will see what the impact will be thanks a lot for joining this recording thank you also for listening keep an eye on Foojay for future articles and podcasts about development and everything related to the Java World thanks a lot thank you so much thanks so very much give me a give me a j give me the of OpenJDK

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

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

Pavel Petroshenko

Senior Director of Product Management at Azul Systems

Related posts

Join the discussion