Lesson learned from Java modules and Robo4j
summary
Robo4j and Pi4J are fully modularized so the build uses the module path and jlink to produce tiny deterministic JVM images; the project runs on multiple Raspberry Pis, discovers units over the network, and drives hardware (demo writes to an LCD across 3 units) while a pool of 10 worker threads processes parallel sensor streams. Monitoring uses Grafana; automatic modules let non-modular libs run initially; migration tips include fixing illegal access at compile time and preferring one-directional dependencies to avoid classpath surprises. Performance claims: Java can be as fast as native C in these robotics scenarios.
AI-written summary · about
chapters (16)
- 0:00Introduction and context
- 3:33Evolution and technology shifts
- 7:08Encapsulation and complexity
- 13:17Robo4J vision and planning
- 15:45Threading and sensor integration
- 17:53Patterns in software development
- 20:03Java module system requirements
- 22:53Class path vs module path
- 26:03Module system benefits
- 29:15Modularization strategy
- 32:03Automatic modules
- 33:52Demo: Module visualization
- 35:37Demo: LCD panel output
- 36:43Demo: Monitoring system
- 37:45Demo: Multi-threaded servos
- 40:19Conclusion and future outlook
related talks
35mRobotics on Java Simplified
46mRaspberry Pi with Java 9
44mBuilding Smart Devices using Java on the RaspberryPi-An intro to Pi4J.
04mJavaOne Shanghai: Alex Mironenko
16mHaving fun with Pi4J and JBang on the Raspberry Pi
36mHaving fun with Java and JavaFX on the Raspberry Pi
02mHighlight
06mLightning Talk: Using Java to build robots with high schoolers
