adam bien's blog

Listing All Environment Variables ...With Java 8 And JavaScript 📎

With Java 8 you can use JavaScript / Nashorn instead of bash / zsh syntax for shell scripting:

#!/usr/bin/jjs -fv
for (entry in $ENV) {
    print(entry + "->" + $ENV[entry]);
}

JavaScript shell scripting is particularly interesting for automation and system testing.

See you at Java EE Workshops at MUC Airport or on demand and in a location very near you: airhacks.io!