Home

Awesome

roast

A JVM starter in Rust

roast is a small executable that launches a JVM, similar to what using jpackage would output. It uses a config file to determine some options, inspired by packr json format.

In addition to launching the JVM, it hints Windows systems with hybrid GPU setups (NVIDIA Optimus, AMD PowerXpress) to use the discrete GPU.

API

roast will look for the following in its containing folder

Runtime

A JDK/JRE, or a minimized image from jlink, in the runtime folder.

JSON config file

The config file must be in the app folder, and must have the same name as the executable, so for example, if your executable is game (or game.exe), the config file will be app/game.json.

It's possible to have multiple copies of roast named differently to support different launch options on the same runtime. For example, you could have game and game-debug executables corresponding to app/game.json and app/game-debug.json.

The config file supports the following options:

For example:

{
  "classPath": ["app.jar"],
  "mainClass": "io.github.fourlastor.Main",
  "useZgcIfSupportedOs": true,
  "useMainAsContextClassLoader": false,
  "vmArgs": ["-Xmx1G"],
  "args": ["cli", "args"]
}