Support jpkl executable for Windows (#872)

This updates the script used to start the executable to support
Windows as well.

For Windows support, the executable needs to be named `jpkl.bat`.
This commit is contained in:
Daniel Chao
2025-01-14 05:16:59 -08:00
committed by GitHub
parent 3296dd8a89
commit 100dd0560e
3 changed files with 44 additions and 16 deletions

View File

@@ -53,8 +53,7 @@ whereas, the Alpine Linux executable is statically linked against _musl libc_ an
====
The Java executable works on multiple platforms and has a smaller binary size than the native executables.
However, it requires a Java 17 (or higher) runtime on the system path, has a noticeable startup delay,
and runs complex Pkl code slower than the native executables.
However, it requires a Java 17 (or higher) runtime on the system path, and has a noticeable startup delay.
All flavors are built from the same codebase and undergo the same automated testing.
Except where noted otherwise, the rest of this page discusses the native executables.
@@ -201,6 +200,14 @@ NOTE: We currently do not support the aarch64 architecture for Windows.
[[java-executable]]
=== Java Executable
The Java executable is a jar that can be executed directly on macOS, Linux, and Windows.
It requires `java` to be installed, and available on `$PATH`.
[tabs]
====
macOS/Linux::
+
[source,shell]
[subs="+attributes"]
----
@@ -209,6 +216,16 @@ chmod +x jpkl
./jpkl --version
----
Windows::
+
[source,PowerShell]
[subs="+attributes"]
----
Invoke-WebRequest '{uri-pkl-java-download}' -OutFile jpkl.bat
.\jpkl --version
----
====
This should print something similar to:
[source,shell]
@@ -217,8 +234,7 @@ This should print something similar to:
Pkl {pkl-version} (macOS 14.2, Java 17.0.10)
----
NOTE: The Java executable does not work as an executable file on Windows.
However, it will work as a jar, for example, with `java -jar jpkl`.
NOTE: The Java executable is named `jpkl`.
[[usage]]
== Usage
@@ -721,8 +737,6 @@ Type :help or :examples for more information.
pkl>
----
NOTE: The Java executable is named `jpkl`.
=== Loading Modules
To load <<config.pkl,`config.pkl`>> into the REPL, run: