Return to site

JBang: Run java as scripts anywhere.

· java

1) Given this class:

2) Open Powershell in Windows, typing "PowerShell" in Cortana search box.

3) Change of directory in PowerShell to the directory containing the "hello.java" file:

cd my_directory

4) Execute this command line in PowerShell:

iex "& { $(iwr https://ps.jbang.dev) } ./hello.java"

BANG!!!

Here you go, you are executing Java code in a very trivial way!

broken image