New candidate JEP: 408: Simple Web Server

Alex Buckley alex.buckley at
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 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 
jdk.compiler module)
- The HTTP Server API (two com.sun packages exported by the 
jdk.httpserver module)
- 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:
> Hi,
> 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.
> Regards,
> Krzysztof Krason
> On Mon, Mar 29, 2021 at 9:16 PM <mark.reinhold at> 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 mailing list