name: inverse layout: true class: center, middle, inverse --- # Java as shell script .footnote[18.12.2024 Erlend Nossum] ??? Made with: https://github.com/gnab/remark Inspired by https://www.redpill-linpro.com/techblog/2024/02/21/java-21-shell-scripts.html --- layout: false # Agenda - Run java as shell script - ... using modern java constructions --- # When is this useful? Shell scripts are used to perform and organize simple tasks. - Bash scripts quickly get **untenable**. - You can get type safety and other **niceness** when using Java - Example: Load **test data into database** - Instead of a disabled junit test that loads a database with example data, you can create a script which has better transparency, and also **easier to document** - When you do not want or need a full-blown jar application - Distribution and **documentation** is easy --- # Hello world This is the modern version of hello world in java: ```shell cat > /tmp/hello <
/tmp/hello <
/tmp/hello <