= Java Single-File Scripts

:language: Java
:language-small: java
:language-ext: java

include::partial$Script_Header.adoc[]


== Script Use Cases

include::partial$example/javalib/script/1-html-scraper.adoc[]
include::partial$example/javalib/script/2-json-api-client.adoc[]
include::partial$example/javalib/script/3-web-server.adoc[]
include::partial$example/javalib/script/4-database.adoc[]
include::partial$example/javalib/script/5-static-site.adoc[]


== Packaging Assemblies and Native Binaries

include::partial$example/javalib/script/6-packaging.adoc[]

== Opening a Script REPL

To open a Java REPL with your script loaded and available, you can use the following command.
This can be useful to interactively exercise and experiment with the code defined in
your script.

```scala
./mill Foo.java:jshell
```


== Script moduleDeps

include::partial$example/javalib/script/7-script-deps.adoc[]

== Relative and Absolute Script moduleDeps

include::partial$example/javalib/script/8-relative-deps.adoc[]

== Project `moduleDeps`

include::partial$example/javalib/script/9-programmable-module-deps.adoc[]

== Custom Script Module Classes

include::partial$example/javalib/script/10-custom-class.adoc[]


== Script Resources

include::partial$example/javalib/script/11-resources.adoc[]

include::partial$Script_Footer.adoc[]

== Custom JVM Versions

include::partial$example/javalib/script/12-jvm-version.adoc[]