21 comments

  • mooreds 8 months ago

    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...

  • kunley 8 months ago

    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.

    • dpassens 8 months ago

      > 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.

      • kunley 8 months ago

        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.

    • nicolai-parlog 8 months ago

      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.

      • kunley 8 months ago

        Are you sure it's intentional? A paragraph further down they are using placeholders with underscores

  • sushidev 8 months ago

    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.

  • vbezhenar 8 months ago

    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.

    • vips7L 8 months ago

      They are working on this with Project Leyden. https://cr.openjdk.org/~jiangli/hermetic_java.pdf

    • alex_suzuki 8 months ago

      You can use jlink‘s output image as the input for jpackage: https://docs.oracle.com/en/java/javase/17/docs/specs/man/jpa...

      • vips7L 8 months ago

        Doens't jpackage still just make installers and not a single binary you can just run?

    • neonsunset 8 months ago

      That’s how .NET’s single-file publish works (one of its modes).

    • pjmlp 8 months ago

      You want GraalVM, OpenJ9 for that.

      Additionally there is jpackage.

      • vbezhenar 8 months ago

        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.

        • pjmlp 8 months ago

          Yeah, but that isn't like Go.

          As mentioned, there is jpackage.

          • vbezhenar 8 months ago

            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.

  • jtrueb 8 months ago

    This has nothing to do with SEGGER JLink. I wonder which is older.

    • alex_suzuki 8 months ago

      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.

    • usmanmehmood55 8 months ago

      My dumb*s though it was about Segger JLink also lol