Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundled Java Runtime #468

Closed
4 of 6 tasks
tresf opened this issue Jul 18, 2019 · 4 comments · Fixed by #770
Closed
4 of 6 tasks

Bundled Java Runtime #468

tresf opened this issue Jul 18, 2019 · 4 comments · Fixed by #770
Assignees
Milestone

Comments

@tresf
Copy link
Contributor

tresf commented Jul 18, 2019

Placeholder to track the progress of bundling the Java Runtime into the installers.

  • Download and extract the target JDK:
    Note: ant makes this tricky. See download-javafx as an example.
    • ant nsis - Download Windows 64-bit JDK
    • ant pkgbuild - Download MacOS 64-bit JDK
    • ant makeself - Download Linux 64-bit JDK
  • Locate required JRE components using jlink, bundle into <INSTALL_DIR>\jre folder.
  • Ensure all installers use same JRE detection technique (see the NSIS FindJRE function) (done via Dynamic cert support, rewrite installers #504)
  • Installer to use the bundled java, javaw, keytool when available (covered elsewhere)
  • Work through deployment nuances
  • Pass macOS notarization
@tresf
Copy link
Contributor Author

tresf commented Jun 12, 2020

Initial proof of concept available https://github.com/qzind/tray/tree/jlink

@tresf tresf self-assigned this Jun 12, 2020
@tresf tresf added this to the 2.1.2 milestone Jun 12, 2020
@tresf
Copy link
Contributor Author

tresf commented Jun 17, 2020

A small caveat... if building using a newer Java runtime, jlink will fail. More details here: https://bugs.openjdk.java.net/browse/JDK-8204256

Error: jlink version 13.0 does not match target java.base version 11.0

In ant, the error is not obvious, instead it'll say:

Installation step jlink failed
   java.io.IOException: An error occurred deploying the jre.  Please check the logs for details.

The workaround is to make sure your jlink version is the same major version between that being downloaded (e.g. AdoptOpenJDK11) and that being used to build (e.g. Homebrew's openjdk@11). So on a system which defaults to openjdk14, you have to roll it back to openjdk11:

brew uninstall --ignore-dependencies openjdk
brew install openjdk@11
ln -s /usr/local/opt/openjdk@11 /usr/local/opt/openjdk

@tresf
Copy link
Contributor Author

tresf commented Jun 18, 2020

The bundled Java Runtime is now functional on thejlink branch for Windows and macOS. The installers succeed without asking to Download Java.

I'm still working through some serious startup issues on MacOS, I assume to be permissions related...

java.io.IOException: Cannot run program "defaults": error=316, posix_spawn failed
java.io.IOException: Cannot run program "pgrep": error=2, No such file or directory
java.io.IOException: Cannot run program "whoami": error=0, posix_spawn failed
java.io.IOException: Cannot run program "security": error=2, No such file or directory
java.io.IOException: Cannot run program "system_profiler": error=2, No such file or directory
java.io.IOException: Cannot run program "launchctl": error=2, No such file or directory

@Vzor-
Copy link
Contributor

Vzor- commented Jun 23, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants