Quality Outreach Heads-up - JDK 21 - New Network Interface Names on Windows
David Delabassee on May 8, 2023The OpenJDK Quality Group is promoting the testing of FOSS projects with OpenJDK builds as a way to improve the overall quality of the release. This heads-up is part of a regular communication sent to the projects involved. To learn more about the program, and how-to join, please check here.
JDK 21 - New Network Interface Names on Windows
Network Names that the JDK assigns to network interfaces on Windows are changing in JDK 21.
The JDK historically synthesized names for network interfaces on Windows. This has changed to use the names assigned by the Windows operating system. For example, the JDK may have historically assigned a name such as “eth0” for an ethernet interface and “lo” for the loopback interface. The equivalent names that Windows assigns may be names such as “ethernet_32768” and “loopback_0”.
This change may impact code that does a lookup of network interfaces with the NetworkInterace.getByName(String name)
method. It also may
also be surprising to code that enumerates all network interfaces with the NetworkInterfaces.networkInterfaces()
or NetworkInterface.getNetworkInterfaces()
methods as the names of the network interfaces will, in JDK 21, look different. Depending on configuration, it is possible that enumerating all network interfaces will enumerate network interfaces that weren’t previously enumerated because they didn’t have an Internet Protocol address assigned. The display name returned by NetworkInterface::getDisplayName
has not changed so this should facilitate the identification of network interfaces when using Windows native tools.
For more details, please check JDK-8303898.