The set of supported locales varies between different implementations of the Java Platform Standard Edition (Java SE) as well as between different areas of functionality. This page documents locale support in Oracle's Java SE Development Kit 25 (JDK).
The JDK Installers are localized to the languages specified in the User Interface Translation table. The installers will use the system's default locale setting to determine which of the supported languages to use at the time of installation. If the system's default locale is not supported by the installers, the installers will be displayed in English.
The support for locale-sensitive behavior in the java.util and
java.text packages is almost entirely platform independent, so
all locales are supported in the same way and simultaneously,
independent of the host operating system and its localization.
The only platform dependent functionality is the setting of the
initial default locale and the initial default time zone based on
the host operating system's locale and time zone.
Oracle's JDK 25 supports all the locales provided by the locale data providers given below.
The locales in Oracle's JDK 25 are provided by multiple data sources. They are grouped by their providing sources (hereafter, call it as "locale data provider"). In JDK 25, the following three locale data providers are supported.
CLDR: CLDR locales based on the Unicode Consortium’s
CLDR release 47. All the locales provided by the CLDR are
supported in Oracle's JDK 25, except that BreakIterator and
Collator data are not adopted.HOST: A provider that reflects the user's custom settings in
the underlying operating system. This provider enables the
default locale(s) (Locale.Category.FORMAT and/or
Locale.Category.DISPLAY) utilizing the underlying operating
system. In Oracle's JDK 25, this provider is available on Windows
platform and macOS platform.SPI: Represents the locale sensitive services implementing
the locale sensitive SPIs in java.text.spi and/or java.util.spi
packages.Note that the legacy locale data provided by COMPAT/JRE
locale providers in prior releases are now removed. See JEP 252:
Use CLDR Locale Data by Default, including how to migrate to
CLDR, for more information.
In Oracle's JDK 25, locale data from the CLDR locale data provider
are used by default. In some cases where legacy locales are
specified in locale sensitive services, such as JP variant of
ja_JP locale, the legacy locale data, previously provided by
COMPAT provider is used. Locales from other locale providers
can be used by configuring the java.locale.providers system property. For example,
if the user wants to have the same experience with the underlying
operating system, specifying the system property with
HOST,CLDR lets the locale sensitive services behave like what
the underlying OS does for the default locale. The default
behavior is equivalent to specifying the system property with
CLDR.
See the java.util.spi.LocaleServiceProvider
class in the JDK 25 JavaDoc API documentation for more information.
Unicode Consortium's LDML specification defines Unicode locale extensions. These are the supported extensions in Oracle's JDK 25:
cu (currency type)fw (first day of week)rg (region override)tz (time zone)co (collator; only for Swedish Traditional sorting
(trad))These Unicode extensions affect the behavior of the relevant
library functions, such as classes in java.text, java.time, and
java.util packages. See JEP 314: Additional
Unicode Language-Tag Extensions for more information (except collation).
In Oracle's JDK 25, only the US English locale data (and its
parent locales, including the ROOT locale) are included in the
java.base module. Other locale data are included in the
jdk.localedata module. By default, all locale data is available
in the JDK. Developers can create a smaller run-time image by
stripping unneeded locale data by using the jlink command with
the --include-locales option. For example, if a
user wants to limit locale data to English, Japanese, and all
Indian locales, the following jlink command option will create
the image:
jlink --add-modules java.base,jdk.localedata
--include-locales en,ja,*-IN (other required jlink options are
omitted here)
Locales Supported by the CLDR Provider
The CLDR provider utilizes the locale data provided by the corresponding CLDR version. For JDK 25, CLDR version 47 data are used. The JDK supports the locales from their "basic" or above coverage levels. See CLDR 47 Release Note for more information.
Historically Supported JDK Locales
| Language (ISO 639) | Coun (ISO 3166) | Variant | Script (ISO 15924) | Language Tag | Note |
|---|---|---|---|---|---|
|
Hebrew ( |
Israel ( |
( |
|
Since JDK 17, Locale constructors convert the obsolete ISO 639 two-letter language code iw to the current one, he. See Legacy language codes in the Locale class in the JDK 25 JavaDoc API documentation. |
|
|
Indonesian ( |
Indonesia ( |
( |
|
Since JDK 17, Locale constructors convert the obsolete ISO 639 two-letter language code in to the current one, id. See Legacy language codes in the Locale class in the JDK 25 JavaDoc API documentation. |
|
|
Japanese ( |
Japan ( |
|
( |
|
Explicitly specifies the Japanese imperial calendar with
|
|
Japanese ( |
Japan ( |
|
( |
|
Explicitly specifies the Japanese imperial calendar with
|
|
Norwegian ( |
Norway ( |
|
( |
|
|
|
Thai ( |
Thailand ( |
( |
|
Implicitly specifies the Latin numbering system and the Thai
Buddhist calendar with |
|
|
Thai ( |
Thailand ( |
|
( |
|
Implicitly specifies the Latin numbering system. Explicitly
specifies the Thai Buddhist calendar with
|
|
Thai ( |
Thailand ( |
|
( |
|
Explicitly specifies the Thai numbering
system and the Thai Buddhist calendar with
|
|
Thai ( |
Thailand ( |
|
( |
|
Explicitly specifies the Thai numbering
system and the Thai Buddhist calendar with
|
|
Yiddish ( |
Ukraine ( |
( |
|
Since JDK 17, Locale constructors convert the obsolete ISO 639 two-letter language code ji to the current one, yi. See Legacy language codes in the Locale class in the JDK 25 JavaDoc API documentation. |
Implicit default scripts are in parentheses. They are not
returned from the Locale.getScript() method.
Locales can be constructed with
Locale.forLanguageTag(<Language Tag>) or
Locale(<Language>, <Country>[, <Variant>])
where <Language Tag> is the Language Tag column value,
<Language> is the ISO 639 value, <Country> is the ISO
3166 value, and <Variant> is the Variant column value if
it’s neither empty nor *.
Locales can be constructed only with
Locale.forLanguageTag(<Language Tag>) if the Variant column
value is *.
For the Java Foundation Classes (JFC), which includes AWT, Swing, 2D, input method framework, and drag and drop, locales can generally be characterized by just the writing system; there are no country or language specific distinctions. Writing system support in the JFC depends to some extent on the host operating system, and full support for simultaneous use of multiple languages is not always possible.
We consider a writing system supported by JFC if all functionality provided by JFC works adequately for this writing system in the following situations:
On Windows, when running with UI Language set to a language using that writing system.
On Linux, when running on a host operating system with the locale set to one using that writing system and one of the encodings shown for that writing system in the table below.
On macOS, when running with the Language set to one using that writing system and one of the encodings shown for that writing system in the following table.
Oracle's JDK 25 supports all writing systems in the following table. Peered AWT components are only supported for a subset of the writing systems – see the last column.
Details on various areas of functionality are provided in the sections following this table.
| Writing System | Languages | Windows Encodings | Linux Encodings | macOS Encodings | Peered AWT Components |
|---|---|---|---|---|---|
|
Arabic |
Arabic |
1256 |
UTF-8 |
UTF-8 |
unsupported |
|
Chinese (Simplified) |
Chinese |
936, GB18030 |
GB18030, UTF-8 |
UTF-8 |
supported |
|
Chinese (Traditional) |
Chinese |
950, HKSCS |
UTF-8 |
UTF-8 |
supported |
|
Cyrillic |
Belarusian, Russian etc. |
1251 |
UTF-8 |
UTF-8 |
supported |
|
Devanagari |
Hindi |
UTF-8 |
unsupported |
UTF-8 |
unsupported |
|
Greek |
Greek |
1253 |
unsupported |
UTF-8 |
supported |
|
Hebrew |
Hebrew |
1255 |
UTF-8 |
UTF-8 |
unsupported |
|
Japanese |
Japanese |
932 |
UTF-8 |
UTF-8 |
supported |
|
Korean |
Korean |
949 |
UTF-8 |
UTF-8 |
supported |
|
Latin – Baltic subset |
Latvian, Lithuanian |
1257 |
unsupported |
UTF-8 |
supported |
|
Latin – Central European subset |
Czech, Hungarian, Polish, etc. |
1250 |
unsupported |
UTF-8 |
supported |
|
Latin – Maltese subset |
Maltese |
UTF-8 |
unsupported |
UTF-8 |
supported |
|
Latin – Turkic subset |
Turkish etc. |
1254 |
unsupported |
UTF-8 |
supported |
|
Latin – Western European subset |
English, French, German, Italian, Spanish, Swedish, etc. |
1252 |
ISO-8859-1, UTF-8 |
UTF-8 |
supported |
|
Thai |
Thai |
874 |
unsupported |
UTF-8 |
unsupported |
Support for text input consists of two parts: interpretation of keyboard layouts, and text composition using input methods. For interpretation of keyboard layouts, the JDK relies entirely on the host operating system. For text composition using input methods, JDK supports native input methods using the host operating system's input method manager (IMM) as well as input methods developed in the Java programming language.
Locale support in input methods implemented in the Java programming language depends solely on the set of installed input methods, not on the host operating system and its localization. However, support for the use of input methods implemented in the Java programming language with peered components is implementation dependent – see the following sections.
Support for keyboard layouts and and native input methods varies between platforms.
Windows
The JDK supports use of any keyboard layout or IMM-based input method.
Input methods implemented in the Java programming language are supported in all components, on all versions of Windows.
Linux
The JDK supports use of any keyboard layout or input method that can be used with a particular Linux locale.
Input methods implemented in the Java programming language are supported in lightweight components (such as Swing text components), but not in peered components (such as AWT text components).
macOS
The JDK supports use of any input source.
Input methods implemented in the Java programming language are supported in lightweight components (such as Swing text components), but not in peered components (such as AWT text components).
Applications have two options for selecting fonts:
Text Rendering in Lightweight Components
When using logical font names, text in at least the writing system of the host locale and the Western European subset of the Latin writing system is supported.
When using physical fonts, we need to distinguish between simple and complex writing systems. Simple writing systems have a one-to-one mapping from characters to glyphs, and glyphs are placed on the baseline continuously from left to right. Complex writing systems may use different glyphs for the same character based on context, may form ligatures, may be written from right to left, and may reorder glyphs during line layout, or may have other rules for placing glyphs (in particular for combining marks).
The 2D text rendering system supports any combination of simple writing systems and the complex writing systems listed in the table Supported Writing Systems. Within these limitations, the range of supported writing systems is determined by the font. A single TrueType font might provide glyphs covering the entire Unicode character set and a Unicode based character-to-glyph mapping. Given such a font, 2D can support all simple writing systems as well as the complex writing systems shown in the table above. Other complex writing systems are not supported.
Text Rendering in Peered Components
When using logical font names, text in at least the writing system of the host operating system's locale is supported.
Physical fonts are not supported in peered components.
Text Rendering in Printing
There are three printing APIs:
java.awt.print.PrinterJob.getPrinterJob method.java.awt.Toolkit.getPrintJob
method.javax.print
package.Text rendering using the AWT and 2D printing API works to the same extent as text rendering on the screen. Text rendering using the pluggable services printing API depends on the printing service used; the services provided by the JDK work to the same extent as text rendering on the screen.
On Windows, text using the entire Unicode character set can be transferred between applications.
On Linux, text in the character encoding of the host operating system's locale can be transferred between applications.
Applications that need to transfer arbitrary text independent
of the host operating system can do so using serialization:
Create a Transferable which supports only one flavor:
DataFlavor.stringFlavor. This flavor represents the serialized
representation of a String. Make sure that the target supports
stringFlavor as well. When the transfer occurs, the AWT will
serialize out the String on one end and deserialize on the other.
This is much slower than a native platform text transfer, but it
will succeed where native transfers may not.
The user interface elements provided by JDK 25 include messages produced by the tools that are only part of the JDK. The user interface elements are localized into the following languages:
| Language | Locale ID |
|---|---|
|
Chinese (Simplified) |
|
|
English |
|
|
German |
|
|
Japanese |
|