New candidate JEP: 408: Simple Web Server
alex.buckley at oracle.com
Tue Mar 30 17:10:49 UTC 2021
Further to Julia's comments:
All of the com.sun namespace is JDK-specific -- it's not part of the
Java SE Platform API.
Around 90% of the com.sun namespace is internal to the JDK -- not
intended for use outside the JDK. An example is the
com.sun.security.ntlm package in the java.base module.
Around 10% of the com.sun namespace is supported for use outside the
JDK. Examples of supported com.sun APIs include:
- The Compiler Tree API (four com.sun packages exported by the
- The HTTP Server API (two com.sun packages exported by the
- The SCTP API (the com.sun.nio.sctp package exported by the jdk.sctp
- JDK-specific extensions to the NIO API (the com.sun.nio.file package
exported by the jdk.unsupported module)
You can view a list of the internal com.sun packages and the supported
com.sun packages at
To aid migration, all of the com.sun packages were open for reflection
_by default_ in JDK 9 through 15. Things were tightened up in JDK 16,
and from JDK 17 you will need to use `--add-opens` if your application
or library code wants to reflect over a com.sun package. You will still
be able to program directly against the _supported_ com.sun packages,
such as the HTTP Server API.
Finally, a related point: The sun.misc package has been exported and
available for reflection since JDK 9. It was neither removed nor
strongly encapsulated in JDK 9. It was available in JDK 9, and continues
to be available in JDK 17.
On 3/29/2021 10:51 PM, Krzysztof K. wrote:
> Is there a plan to change the package name?
> I always thought that com.sun.* package was for old internal code and I
> assume I'm not the only one.
> Krzysztof Krason
> On Mon, Mar 29, 2021 at 9:16 PM <mark.reinhold at oracle.com> wrote:
>> Summary: Provide a command-line tool to start a minimal web server
>> that serves static files in the current directory. This low-threshold
>> utility will be useful for prototyping, ad-hoc coding, and testing
>> purposes, particularly in educational contexts.
>> - Mark
More information about the jdk-dev