Do people actually use jlink? (split from JNI discussion)
Attila Kelemen
attila.kelemen85 at gmail.com
Wed Sep 6 19:17:21 UTC 2023
Though I currently have no need for jlink, in Java 8 times I have packaged
the JRE with the application, and jlink (and modularized jdk) would have
been immensely useful to me. That is, if I would be working on that project
(or similar), I would have switched to a modularized application instantly
and would have used jlink. Granted, it would not have been too difficult
for me, because I always kept my code very modularized (just didn't have
module-info at the time). My main annoyance would have come from the fact
that you have to put redundant information into module-info.java (which
bothers me to this day, but tools don't really let me get away without the
redundancy without giving up on something).
Though my answer does not add to your counter, what I meant is that for
those who need it there is a big motivation, and I know this from
experience. I think the main issue is that people simply don't know about
it. Given my experience, people just don't follow what there is in
Java, they will just keep doing what they did before. And if you
take away something, they will just find the closest thing. Just to horrify
some people: Given my extensive experience in interviewing average devs,
there are a *lot* of people who don't even know what a lambda is in Java to
this day (these people usually believe it is some kind of special syntax
for the Stream API), and almost nobody knows what wildcard types mean. As
for how to push the knowledge to people, I have no idea :(
Stephen Colebourne <scolebourne at joda.org> ezt írta (időpont: 2023. szept.
6., Sze, 13:10):
> On Wed, 6 Sept 2023 at 10:22, Ron Pressler <ron.pressler at oracle.com>
> wrote:
> > So we’ve worked for years on that and delivered a feature that allows
> any Java application to pick a runtime and configure it as it wishes
> (jlink). These days, if an application has difficulty choosing or
> configuring its runtime, it’s by choice. If lack of control over the
> runtime poses a problem for your application, why are you choosing not to
> control the runtime?
>
> I think it is important to ask how widespread usage of jlink actually
> is? Is this something the Oracle team has data on?
>
> The messaging I see around jlink is that it is only useful if every
> part of your application is modular. While this isn't accurate, it is
> true that it is more hassle when not everything is modular. Given that
> most people depend on open source libraries, and a lot of those
> (probably most) are not modular, my assumption is that most people
> don't use jlink? Trying to manually convert jars to be modular just to
> satisfy jlink seems like a fools errand / mad book-keeping exercise.
> Using a tool to convert jars seems to be injecting a step in the build
> pipeline that alters code, so that what you run isn't what you tested.
>
> (Most open source libraries are not modular as modules bring pain with
> no benefits to an open source library)
>
> When the Oracle team removed the JRE, my take is that most people just
> switched to deploying the JDK instead rather than adding jlink as a
> complication. But perhaps I'm wrong? Depending on a shared Java
> runtime still seems like a pretty normal model to me. Even if the
> shared runtime is in Docker.
>
> FWIW, I suspect deploying the JDK instead of the JRE is actually worse
> for security, which is ironic given all the discussion around the
> "threat" of native code.
>
> My concern here is that the Oracle team is making assumptions about
> how Java is deployed which aren't actually realistic.
>
> Stephen
> PS. IMO it is a design flaw that jlink can't handle non-modular jar files
> PPS: IMO it is a design flaw that there was a split between the
> classpath and modulepath
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jdk-dev/attachments/20230906/1a8c4937/attachment.htm>
More information about the jdk-dev
mailing list