You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| platform | one of "windows64", "linux64", "mac" |
39
-
| jdk | Directory, zip file, tar.gz file, or URL to an archive file of an OpenJDK 8 or Oracle JDK 8 build containing a JRE. Adopt OpenJDK 8, 11, and 14 are tested against <https://adoptopenjdk.net/releases.html>. You can also specify a directory to an unpacked JDK distribution. E.g. using ${java.home} in a build script|
37
+
| jdk | Directory, zip file, tar.gz file, or URL to an archive file of a JRE or Java 8 JDK with a JRE folder in it. Adopt OpenJDK 8, 11, and 15 are tested against <https://adoptopenjdk.net/releases.html>. You can also specify a directory to an unpacked JDK distribution. E.g. using ${java.home} in a build script.|
40
38
| executable | name of the native executable, without extension such as ".exe" |
41
39
| classpath | file locations of the JAR files to package |
42
40
| removelibs (optional) | file locations of JAR files to remove native libraries which do not match the target platform. See below for details. |
43
41
| mainclass | the fully qualified name of the main class, using dots to delimit package names |
44
-
| vmargs | list of arguments for the JVM, without leading dashes, e.g. "Xmx1G" |
45
-
| useZgcIfSupportedOs | 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." |
42
+
| vmargs (optional) | list of arguments for the JVM, without leading dashes, e.g. "Xmx1G" |
43
+
| 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." |
46
44
| resources (optional) | list of files and directories to be packaged next to the native executable |
47
-
| minimizejre | 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. |
45
+
| 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. |
48
46
| output | the output directory. This must be an existing empty directory or a path that does not exist. Packr will create the directory if it doesn't exist but will fail if the path is not a directory or is not an empty directory. |
49
47
| cachejre (optional) | An optional directory to cache the result of JRE extraction and minimization. See below for details. |
50
48
| icon (optional, OS X) | location of an AppBundle icon resource (.icns file) |
51
49
| bundle (optional, OS X) | the bundle identifier of your Java application, e.g. "com.my.app" |
52
-
| verbose | prints more status information during processing, which can be useful for debugging |
50
+
| verbose (optional) | prints more status information during processing, which can be useful for debugging |
53
51
| help | shows the command line interface help |
54
52
55
53
Alternatively, you can put all the command line arguments into a JSON file which might look like this:
@@ -150,20 +148,20 @@ The following entitlements when signing the PackrLauncher executable are known t
150
148
If all the bundled dylibs are signed, fewer entitlements might be possible. When using Java 8, `com.apple.security.cs.allow-unsigned-executable-memory`, and `com.apple.security.cs.disable-executable-page-protection` were not needed.
151
149
152
150
### Example macOS code signing and notarization command line steps
153
-
These steps assume you have an Apple developer account, have saved your Apple code signing certificate into Keychain and have generated an API token for your Apple developer account, allowing you to pass your username and token as command line arguments. The example commands also assume you saved the API token in your Keychain allowing these commands to run in an automated way, e.g., your CI pipeline can execute all these commands.
151
+
These steps assume you have an Apple developer account, have saved your Apple code signing certificate into Keychain and have generated an [app-specific password](https://support.apple.com/en-us/HT204397) for your Apple developer account, allowing you to pass your username and token as command line arguments. The example commands also assume you saved the app-specific password in your Keychain allowing these commands to run in an automated way, e.g., your CI pipeline can execute all these commands.
154
152
1.`codesign --sign <keychain id for certiticate> --verbose=10 --timestamp --force --options runtime --entitlements <path-to-entitlements-file> <path to exe or shared lib>`
155
153
* You have to codesign every executable and shared library, --deep is for ["emergency repairs"](https://developer.apple.com/library/archive/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG404).
* If this step fails, it will exit with a non-zero return code and provide good output as to why it failed. E.g., "You must first sign the relevant contracts online."
160
158
161
159
**Optional steps, you can choose to wait for an email notification**
162
-
1.`xcrun altool --notarization-history 0 -u <username> -p "@keychain:<api token ID for username>" --output-format xml`
* This command grabs the history for the **last** call to `xcrun altool --notarize-app`, this will obviously fail if you're running multiple `xcrun altool --notarize-app` processes in parallel. You'll have to come up with a better way to parse the history.
164
162
2. Parse the XML output for the last request UUID, regex: `<string>(.*?)</string>`
165
163
3. In a loop, every minute check the notarization status.
166
-
*`xcrun altool --notarization-info <parsed uuid> -u <username> -p "@keychain:<api token ID for username>"`
4. Parse the output for the status, regex: `.*?Status:\s+(.*?)$`
168
166
5. When the status no longer matches `in progress` exit the loop.
169
167
6. If the `Status` did not end up as `success` the output will provide a description of what went wrong.
@@ -307,7 +305,7 @@ This is an example Hello world style application that bundles itself using packr
307
305
This project downloads JDKS 8, 11, and 14 and runs jlink on the 11 and 14 versions to create minimal JREs for use by PackrAllTestApp.
308
306
309
307
## Limitations
310
-
* Only Adopt OpenJDKs 8, 11, and 14 are tested (other JDKs probably work)
308
+
* Only Adopt OpenJDKs 8, 11, and 15 are tested (other JDKs probably work)
311
309
* Icons aren't set yet on Windows and Linux, you need to do that manually.
312
310
* Minimum platform requirement on MacOS is OS X 10.10 (Only 10.15 macOS Catalina is actively tested, there are users that report 10.14 works).
313
311
* JRE minimization is very conservative. Depending on your app, you can carve out stuff from a JRE yourself, disable minimization and pass your custom JRE to packr. If you're using Java 11+ you should create a JRE using [jlink](https://docs.oracle.com/en/java/javase/11/tools/jlink.html).
0 commit comments