Skip to content

Commit d64c41e

Browse files
nedtwiggkarlsabo
authored andcommitted
vmArgs argument header needs its arguments to lead with -, but it claims not to.
The documentation claims that arguments header `vmArgs` should not have a leading `-`, but my testing shows that they do need to have a leading `-`.
1 parent 2f257ac commit d64c41e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ java -jar packr-all.jar \
2525
--executable myapp \
2626
--classpath myjar.jar \
2727
--mainclass com.my.app.MainClass \
28-
--vmargs Xmx1G \
28+
--vmargs -Xmx1G \
2929
--resources src/main/resources path/to/other/assets \
3030
--output out-mac
3131
```
@@ -39,7 +39,7 @@ java -jar packr-all.jar \
3939
| classpath | file locations of the JAR files to package |
4040
| removelibs (optional) | file locations of JAR files to remove native libraries which do not match the target platform. See below for details. |
4141
| mainclass | the fully qualified name of the main class, using dots to delimit package names |
42-
| vmargs (optional) | list of arguments for the JVM, without leading dashes, e.g. "Xmx1G" |
42+
| vmargs (optional) | list of arguments for the JVM, including leading dashes, e.g. "-Xmx1G" |
4343
| useZgcIfSupportedOs (optional) | When bundling a Java 14+ JRE, the launcher will check if the operating system supports the [Z garbage collector](https://wiki.openjdk.java.net/display/zgc/Main) and use it. At the time of this writing, the supported operating systems are Linux, macOS, and Windows version 1803 (Windows 10 or Windows Server 2019) or later." |
4444
| resources (optional) | list of files and directories to be packaged next to the native executable |
4545
| minimizejre (optional) | Only use on Java 8 or lower. Minimize the JRE by removing directories and files as specified by an additional config file. Comes with a few config files out of the box. See below for details on the minimization config file. |
@@ -65,7 +65,7 @@ Alternatively, you can put all the command line arguments into a JSON file which
6565
],
6666
"mainclass": "com.my.app.MainClass",
6767
"vmargs": [
68-
"Xmx1G"
68+
"-Xmx1G"
6969
],
7070
"resources": [
7171
"src/main/resources",
@@ -87,7 +87,7 @@ It is possible to combine a JSON configuration, and the command line. For single
8787
This is an example which overrides the output folder and adds another VM argument. Note that the config file name is delimited by `--` because the option prior to it, `--vmargs`, allows multiple arguments:
8888

8989
```bash
90-
java -jar packr-all.jar --output target/out-mac --vmargs Xms256m -- my-packr-config.json
90+
java -jar packr-all.jar --output target/out-mac --vmargs -Xms256m -- my-packr-config.json
9191
```
9292

9393
Finally, you can use packr from within your Java code. Just add the JAR file to your project, either manually, or via the following Gradle dependency:
@@ -116,7 +116,7 @@ config.executable = "myapp";
116116
config.classpath = Arrays.asList("myjar.jar");
117117
config.removePlatformLibs = config.classpath;
118118
config.mainClass = "com.my.app.MainClass";
119-
config.vmArgs = Arrays.asList("Xmx1G");
119+
config.vmArgs = Arrays.asList("-Xmx1G");
120120
config.minimizeJre = "soft";
121121
config.outDir = new java.io.File("out-mac");
122122
config.useZgcIfSupportedOs = true;

0 commit comments

Comments
 (0)