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

[Idea] JDK 9's jlink & sbt-native-packager? #1043

Closed
ScalaWilliam opened this issue Oct 9, 2017 · 5 comments
Closed

[Idea] JDK 9's jlink & sbt-native-packager? #1043

ScalaWilliam opened this issue Oct 9, 2017 · 5 comments

Comments

@ScalaWilliam
Copy link
Contributor

I'm wondering if there's anything that can be done with sbt-native-packager and JDK 9's jlink?

Here's the JEP:

Regards,
William

@muuki88
Copy link
Contributor

muuki88 commented Oct 11, 2017

Hi,

This is an interesting topic. I'm not sure yet if this is in scope for native-packager. Still if you have a good use case 😀

@avkonst
Copy link

avkonst commented Oct 19, 2017

I have got a use case for this. My current build process is the following:

However, the size of the image is a problem: 5MB Alpine Linux OS + 30MB my java classes + 90MB JRE. So, I would like to use jlink to cut these 90MB of JRE. My build process would look like the following:

  • Use sbt-native-package (which invokes jlink) to produce a zip package, which includes my java application classes, script runner and minimal image of JRE produced by jlink
  • Unpack this zip tarball to inside of my docker image based on bare Alpine Linux image which is only 5MB.

As a result, I should get the same redistributable docker image, but much smaller in size.

@zabhi
Copy link

zabhi commented Aug 22, 2018

Here is a parallel effort working to bring this to maven: maven-jlink-plugin

@Sciss
Copy link
Contributor

Sciss commented Mar 27, 2019

any news on this? wondering how I can create jdk bundled installation packages compatible with Java 11 using sbt-native-packager; I need to build for Linux, Windows, Mac, but only run Linux, so this seems all very complicated. Would jlink offer a solution here?

@muuki88
Copy link
Contributor

muuki88 commented Jul 14, 2019

@nigredo-tori created an amazing jlink plugin. Available since v1.3.21 and improved till the latest version (v1.3.25)

See https://sbt-native-packager.readthedocs.io/en/latest/archetypes/misc_archetypes.html#jlink-plugin

@muuki88 muuki88 closed this as completed Jul 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants