5 things I learnt about Java 10 at the Jenkins Hackathon
Now that the Jenkins & Java 10 Online Hackathon is behind us, Tracy Miranda looks back at the event and shares the things she learned about Jenkins and Java 10.
Recently I participated in the Jenkins & Java 10 Online Hackathon. The hackathon featured JDK Project Jigsaw committers Mandy Chung and Paul Sandoz, as well as Jenkins creator Kohsuke Kawaguchi.
It was a great opportunity for me to learn a lot about Jenkins and Java 10.
Why Java 10?
With the Java 8 EoL data looming, the focus was on the current available version of Java, Java 10. Java 10 offers some nice new features and APIs, not least improved docker container integration. We learned from Paul of a number of projects with Java 10 migration success stories including Elasticsearch, Kafka & Netty. At the beginning of the hackathon week, the Jenkins Pipeline feature would crash out when using Java 10. This was resolved with a number of fixes including the upgrade of the ASM library. Then it was nice to see things up and running with Java 10.
Java 10 new APIs
Many of the Java 10 issues were related to Illegal reflective access from various plugins or third-party libraries. Removing these warnings requires a good architectural knowledge of the plugin or core code itself for instance upgrading the version of jdom. Definitely something to be done carefully especially when classloaders are involved.
While looking at removing reflection in cases of isAccessible calls, the ProcessHandle api is what was needed. It is a good replacement for some misuse of reflection, and even better it made certain bits of code work on Windows too. Mandy also pointed us to look at the Lookup api as possible alternate to findClass calls.
Multi-release JAR builds
Using new APIs is all well and good but presents a problem when you want to maintain backwards compatibility with Java 8. Hence the need for some sort of multi-jar solution – Nicolas De loof proposed one such solution for multi-release jars with Maven for this case.
The Java Signal API is being deprecated, but so far no replacement APIs are available for signal handling. Jenkins makes use of the Signal APIs so a big question for the Jigsaw team was whether this would be replaced going forward. Kohsuke pointed out how it is important for Java to maintain this UNIX like behaviour as it shouldn’t matter to end users that Jenkins is written in Java. It seems these APIs will be replaced in due course, they just aren’t there right now.
Collaboration, collaboration, collaboration
It was great to have the discussions with the Jigsaw team. They reminded us how they need to know the Java use cases out there and how their team uses these to feed into their development process. In turn, the hackathon had Jenkins community members participate, for instance, easy-jenkins was up and running with Java 10 by the end of the week. The hackathon had a great feeling of community spirit and was a reminder why collaborations with communities and also between different communities can be powerful and fun for all involved.
At the end of the week, I was happy to have made my first Jenkins contributions (which were reviewed and merged quickly) as well as learn lots about Java 10. Thanks to all who participated and made it highly enjoyable. The next one will be around JenkinsWorld and I’m really looking forward to that!