1. 8
  1. 2

    Question for anyone who knows Java: why did this need to be baked into the JDK? Does Java not have a package repository that this could be been uploaded too?

    1. 5

      From the opening paragraph of the linked article:

      Other programming languages recognised the need for having a “quick and dirty” way of serving resources over HTTP(S) protocol during the development. Good people that developed JDK 18 gave us the opportunity to have that in Java too so we don’t have to look at node.js, Python or PHP developers with envy any more when they brag how simple it is to start serving resources in their languages.

      Or from the “Motivation” section of the linked JEP:

      A common rite of passage for developers is to serve a file on the web, likely a “Hello, world!” HTML file. Most computer science curricula introduce students to web development, where local testing servers are commonly used. Developers usually also learn about system administration and web services, other areas where development tools with basic server functionality can come in handy. Educational and informal tasks such as these are where a small out-of-the-box server is desirable.

      So, in short, since the motivation was to change the default starting experience it had to be in the starting setup. Package repositories are just irrelevant to the goal.

      1. 1

        Java not have a package repository

        Not a Java dev but I believe not. There is the Maven repo but that isn’t owned by Oracle and Maven isn’t shipped in any capacity by Oracle. Plus, it’s Java - who cares what they throw into the JDK at this point?

      2. 1

        I feel like not supporting more verbs is a big miss here? I don’t develop in Java so maybe I’m missing the point of this built-in development webserver but surely the HTTP verbs would be one of the more important features of a server?

        Edit* I am sure they will add more verbs in the future, just odd they would release this with, what I feel, is a big feature hole.

        1. 2

          I was expecting you to be referring to PUT or something and was confused. Then I saw they don’t support POST. lol.

          Hey at least this can be used to develop stateless, static websites?

          1. 2

            JDK follows a cadence release process. This is the very first provisional release after the most recent LTS release. JDK 11 and 17 are LTS releases. 12-16 we’re provisional releases that gave them a chance to refine proposals in public, gather practical feedback, etc. You can think of it like the old Linux odd versions or like rust “unstable” APIs.