diff --git a/2025/03/jbang_demo1/App.java b/2025/03/jbang_demo1/App.java new file mode 100644 index 0000000..bf7f407 --- /dev/null +++ b/2025/03/jbang_demo1/App.java @@ -0,0 +1,20 @@ +///usr/bin/env jbang "$0" "$@" ; exit $? +//DEPS io.quarkus:quarkus-bom:2.4.0.Final@pom +//DEPS io.quarkus:quarkus-resteasy + +import javax.enterprise.context.ApplicationScoped; +import javax.ws.rs.GET; +import javax.ws.rs.Path; + +// @ApplicationPath("/hello") +@Path("") +@ApplicationScoped +public class App { + + @GET +// @Path("/") + public String handleHello() { + return "OK"; + } + +} diff --git a/2025/03/jbang_demo1/OldApp.java b/2025/03/jbang_demo1/OldApp.java new file mode 100644 index 0000000..93a7e9b --- /dev/null +++ b/2025/03/jbang_demo1/OldApp.java @@ -0,0 +1,19 @@ +///usr/bin/env jbang "$0" "$@" ; exit $? +//DEPS org.wildfly.bom:wildfly-expansion:35.0.1.Final@pom +//DEPS jakarta.ws.rs:jakarta.ws.rs-api +//DEPS jakarta.enterprise:jakarta.enterprise.cdi-api + +import jakarta.enterprise.context.*; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.*; + +@ApplicationPath("/") +@ApplicationScoped +public class App extends Application { + + @Path("/hello") + public String handleHello() { + return "OK"; + } + +} diff --git a/2025/03/jbang_demo1/README.md b/2025/03/jbang_demo1/README.md new file mode 100644 index 0000000..2884c17 --- /dev/null +++ b/2025/03/jbang_demo1/README.md @@ -0,0 +1,21 @@ +# Jbang demo + +## How to install Jbang + +1. Get it from https://sdkman.io/ +2. Install with curl -s "https://get.sdkman.io" | bash + +## How to run it + +Without debugging + +``` +jbang App.java +``` + +with debugging + +``` +jbang --verbose run App.java +``` +