The following describes selected improvements of the Java JVM. See the Java 18 release notes.
With JEP-400, now UTF-8 is the default charset of the standard Java APIs.
In JDK 17 and earlier, the default charset is determined when the Java runtime starts. On macOS, it is UTF-8 except in the POSIX C locale. On other operating systems, it depends upon the user’s locale and the default encoding, e.g., on Windows, it is a codepage-based charset such as windows-1252 or windows-31j.