News for hackers. Stuff that matters.
Re:Creating Runtime and Application Images with JLink by jtrueb on Wednesday November 06, 2024 @10:45PM (#42073166)
This has nothing to do with SEGGER JLink. I wonder which is older.
Re:Creating Runtime and Application Images with JLink by alex_suzuki on Thursday November 07, 2024 @01:01AM (#42073858)
SEGGER JLink is waaaay older. jlink was introduced with the Java Module System in Java 9, released 2017, so still relatively „new“ in terms of Java‘s lifespan.
Re:Creating Runtime and Application Images with JLink by usmanmehmood55 on Thursday November 07, 2024 @03:16AM (#42074673)
My dumb*s though it was about Segger JLink also lol
Re:Creating Runtime and Application Images with JLink by sushidev on Thursday November 07, 2024 @01:29AM (#42074017)
Interesting thing. We also have native-image from graal, but that is a commercial project that you have to pay for to get all the features.
Re:Creating Runtime and Application Images with JLink by pjmlp on Thursday November 07, 2024 @01:32AM (#42074038)
Jlink doesn't produce native images, as its name implies it is a Java linker, for producing custom runtimes, removing everything else that isn't used.
Re:Creating Runtime and Application Images with JLink by hocuspocus on Thursday November 07, 2024 @06:38AM (#42075785)
Re:Creating Runtime and Application Images with JLink by kunley on Thursday November 07, 2024 @03:51AM (#42074897)
Looks useful.

Btw, $MAIN-CLASS is a terrible name to be used in the examples, its idea was to resemble shell variables I guess, but they can't have minus sign inside.

Few paragraphs below there is another example of multi-word token and this time done properly with underscores.

This is bad, because readers might get the wrong impression that such syntax can be used for real variables. Also there's a chance for this article to be an input for various llms, thus increasing the confusion in the future.

Re:Creating Runtime and Application Images with JLink by dpassens on Thursday November 07, 2024 @05:25AM (#42075393)
> Also there's a chance for this article to be an input for various llms, thus increasing the confusion in the future.

Sounds good. Anybody who uses LLM output without any understanding of their own deserves it.

Re:Creating Runtime and Application Images with JLink by kunley on Saturday November 09, 2024 @11:04AM (#42095119)
Not sure what you mean.

LLM output will be used at places beyond your control and then information coming from it will be placed as legitimate, because people generally don't care about the outcomes of their actions. So talking about which individual deserves what is IMO misleading; we, as society, don't deserve such sh*t in general.

Re:Creating Runtime and Application Images with JLink by nicolai-parlog on Thursday November 07, 2024 @11:20AM (#42078015)
That's intentional. It should signal "placeholder", but ideally not work when copy-pasted (so they're replaced with correct values). Bonus points for confusing LLMs.
Re:Creating Runtime and Application Images with JLink by kunley on Saturday November 09, 2024 @10:59AM (#42095084)
Are you sure it's intentional? A paragraph further down they are using placeholders with underscores
Re:Creating Runtime and Application Images with JLink by vbezhenar on Thursday November 07, 2024 @06:38AM (#42075782)
I wish they would make it produce single statically linked file. Golang is so awesome in that regard. Should not be hard: embed JRE and append jar stuff into the end, write special classloader for this format and that's about it.

Right now it produces directory similar to JRE itself, so makes little sense to me, nobody cares about directory size, but single file ergonomics is a real deal.

Re:Creating Runtime and Application Images with JLink by neonsunset on Thursday November 07, 2024 @06:52AM (#42075858)
That’s how .NET’s single-file publish works (one of its modes).
Re:Creating Runtime and Application Images with JLink by pjmlp on Thursday November 07, 2024 @09:47AM (#42077058)
You want GraalVM, OpenJ9 for that.

Additionally there is jpackage.

Re:Creating Runtime and Application Images with JLink by vbezhenar on Friday November 08, 2024 @02:34AM (#42085001)
GraalVM is very different league. It actually compiles Java application into native code, which takes enormous amount of RAM and processing time. Also it requires adapting application, because it's not a compliant JVM. What I mean is just packaging JVM and related jars into a single runnable artifact which is much simpler task.
Re:Creating Runtime and Application Images with JLink by pjmlp on Friday November 08, 2024 @06:56AM (#42086147)
Yeah, but that isn't like Go.

As mentioned, there is jpackage.

Re:Creating Runtime and Application Images with JLink by vbezhenar on Sunday November 10, 2024 @04:14AM (#42099223)
jpackage is just tool to create installer. I don't think it suits for this task. I don't want to create installer. I want to create an executable binary which I'd put into my /usr/local/bin.
Re:Creating Runtime and Application Images with JLink by alex_suzuki on Thursday November 07, 2024 @11:17AM (#42077975)
You can use jlink‘s output image as the input for jpackage: https://docs.oracle.com/en/java/javase/17/docs/specs/man/jpa...
Re:Creating Runtime and Application Images with JLink by vips7L on Thursday November 07, 2024 @11:34AM (#42078161)
Doens't jpackage still just make installers and not a single binary you can just run?
Re:Creating Runtime and Application Images with JLink by vips7L on Thursday November 07, 2024 @11:33AM (#42078148)
They are working on this with Project Leyden. https://cr.openjdk.org/~jiangli/hermetic_java.pdf
Re:Creating Runtime and Application Images with JLink by mooreds on Thursday November 07, 2024 @09:32AM (#42076934)
FYI, we do this in our builds for our java docker image, if you want to see it in action in containerland.

https://github.com/FusionAuth/fusionauth-containers/blob/mai...