Skip to content

Commit

Permalink
use proper native image command on windows (#1473)
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegYch committed Nov 17, 2021
1 parent 89c3180 commit e7e24b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ object GraalVMNativeImagePlugin extends AutoPlugin {
target in GraalVMNativeImage := target.value / "graalvm-native-image",
graalVMNativeImageOptions := Seq.empty,
graalVMNativeImageGraalVersion := None,
graalVMNativeImageCommand := "native-image",
graalVMNativeImageCommand := (if (scala.util.Properties.isWin) "native-image.cmd" else "native-image"),
resourceDirectory in GraalVMNativeImage := sourceDirectory.value / "graal",
mainClass in GraalVMNativeImage := (mainClass in Compile).value
) ++ inConfig(GraalVMNativeImage)(scopedSettings)
Expand Down
4 changes: 1 addition & 3 deletions src/sphinx/formats/graalvm-native-image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ Settings

``native-image`` Executable Command (Pay attention if you are using Windows OS)

Putting ``native-image`` in ``PATH`` does not work for Windows. ``native-image`` is a batch file in Windows that calls another executable to compile the Java classes to a standalone executable. Therefore, the full path to the batch file e.g. ``C:\Program Files\Java\graalvm\bin\native-image.cmd`` must be provided. It is important to include ``.cmd``.

``graalVMNativeImageCommand``
Set this parameter to point to ``native-image`` or ``native-image.cmd``. For Linux, set this parameter if it is inconvenient to make ``native-image`` available in your ``PATH``.
Set this parameter to point to ``native-image`` or ``native-image.cmd``. Set this parameter if it is inconvenient to make ``native-image`` available in your ``PATH``.

For example:

Expand Down

0 comments on commit e7e24b8

Please sign in to comment.