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

Use JRE instead of JDK Desktop Binary #2773

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

rodvar
Copy link
Contributor

@rodvar rodvar commented Sep 6, 2024

Purpose

Approach

  • Use Gradle Java Toolchain --> Couldn't get it to pick up the JRE
  • Download JRE manually and use it for runtime --> Too complicated, increase build times
  • Build a skimmed JRE out of our dev JDK --> Success ! :)

Results

  • Reduction on final binary are around ~160MB (30% less)
  • new results after tweaking some unnecessary mods during review are ~245MB (46% less)
  • This PR is fully tested in MacOS (M1). Also tested that it will run in Windows and Linux, but for those environments I need help as the binary won't generate in my envs even from main branch (Eventually I need to work why is this happening and submit a PR to fix it or fix whatever is wrong in my envs) - Please help test this PR!

How to test this PR

  1. $ ./gradlew apps:desktop:desktop-app-launcher:clean apps:desktop:desktop-app-launcher:generateInstallers --info
  2. you'll find in in apps/desktop/desktop-app-launcher/build folder the custom-jre folder with the gerated skimmed JRE, and in packages/jpackages/package/Bisq2... the installer corresponding to your env (e.g. Bisq2....dmg) . Install it and run the app. Also check the size of the binary. Please comment your results with details on your environment in this PR.

Known Issues / Future lines of improvement

  • Left TODOs in the code to reference this

Dev Commit logs

  • approach using jlink to generate a slim jre from our dev jdk
  • generateInstallers depends on jlink task now
  • work out the list of mods needed for the app to function
  • optimize jlink command to trim as much unneded stuff as possible
  • adjust code for windows env
  • cleanup code, leave TODOs for future lines of improvement/optimization

Copy link
Contributor

@HenrikJannsen HenrikJannsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

See Nits

Would be good if @alvasw could review as well

@rodvar rodvar force-pushed the feature/jre_from_jdk branch 2 times, most recently from 998601c to ea1e059 Compare September 8, 2024 04:49
 - generateInstallers depends on jlink task now
 - work out the list of mods needed for the app to function
 - optimize jlink command to trim as much unneded stuff as possible
 - adjust code for windows env
 - cleanup code, leave TODOs for future lines of
   improvement/optimization
 - gitignore vscode folder
 - added review suggestions
Copy link
Contributor

@HenrikJannsen HenrikJannsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@HenrikJannsen HenrikJannsen merged commit 257653f into bisq-network:main Sep 18, 2024
21 checks passed
@rodvar rodvar deleted the feature/jre_from_jdk branch September 18, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants