• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2layout: default
3title: ICU4J Readme
4nav_order: 8
5parent: ICU
6---
7<!--
8© 2020 and later: Unicode, Inc. and others.
9License & terms of use: http://www.unicode.org/copyright.html
10-->
11
12# ICU4J Readme
13{: .no_toc }
14
15## Contents
16{: .no_toc .text-delta }
17
181. TOC
19{:toc}
20
21---
22
23## Introduction to ICU4J
24
25The International Components for Unicode (ICU) library provides robust and full-featured Unicode services on a wide variety of platforms. ICU supports the most current version of the Unicode standard, including support for supplementary characters (needed for GB 18030 repertoire support).
26
27Java provides a strong foundation for global programs, and IBM and the ICU team played a key role in providing globalization technology to Java. But because of its long release schedule, Java cannot always keep up with evolving standards. The ICU team continues to extend Java's Unicode and internationalization support, focusing on improving performance, keeping current with the Unicode standard, and providing richer APIs, while remaining as compatible as possible with the original Java text and internationalization API design.
28
29ICU4J is an add-on to the regular JRE that provides:
30
31*   [Collation](https://unicode-org.github.io/icu/userguide/collation) – rule-based, up-to-date Unicode Collation Algorithm (UCA) sorting order
32        For fast multilingual string comparison; faster and more complete than the J2SE implementation
33*   [Charset Detection](https://unicode-org.github.io/icu/userguide/conversion/detection) – Recognition of various single and multibyte charsets
34        Useful for recognizing untagged text data
35*   [UnicodeSet](https://unicode-org.github.io/icu/userguide/strings/unicodeset) – standard set operations optimized for sets of Unicode characters
36        UnicodeSets can be built from string patterns using any Unicode properties.
37*   [Transforms](https://unicode-org.github.io/icu/userguide/transforms) – a flexible mechanism for Unicode text conversions
38        Including Full/Halfwidth conversions, Normalization, Case conversions, Hex conversions, and transliterations between scripts (50+ pairs)
39*   [Unicode Normalization](https://unicode-org.github.io/icu/userguide/transforms/normalization) – NFC, NFD, NFKD, NFKC
40        For canonical text representations, needed for XML and the net
41*   [International Calendars](https://unicode-org.github.io/icu/userguide/datetime/calendar) – Arabic, Buddhist, Chinese, Hebrew, Japanese, Ethiopic, Islamic, Coptic and other calendars
42        Required for correct presentation of dates in certain countries
43*   [Date Format Enhancements](https://unicode-org.github.io/icu/userguide/format_parse/datetime)Date/time pattern generator, Relative date formatting, etc.
44        Enhancements to the normal Java date formatting.
45*   [Number Format Enhancements](https://unicode-org.github.io/icu/userguide/format_parse/numbers) – Scientific Notation, Spelled-out, Compact decimal format, etc.
46        Enhancements to the normal Java number formatting. The spell-out format is used for checks and similar documents
47*   [Enhanced Word-Break Detection](https://unicode-org.github.io/icu/userguide/boundaryanalysis) – Rule-based, supports Thai, Khmer, Chinese, etc.
48        Required for correct support of Thai
49*   [Unicode Text Compression](https://unicode-org.github.io/icu/userguide/conversion/compression) – Standard compression of Unicode text
50        Suitable for large numbers of small fields, where LZW and similar schemes do not apply
51*   [Charset Conversion](https://unicode-org.github.io/icu/userguide/conversion) – Conversion to and from different charsets.
52        Plugs into Java CharsetProvider Service Provider Interface (SPI)
53
54> :point_right: **Note:** We continue to provide assistance to Java, and in some cases, ICU4J support has been rolled into a later release of Java. For example, BCP47 language tag support including Unicode locale extensions is now in Java 7\. However, the most current and complete version is always found in ICU4J.
55
56## What Is New In The Current Release?
57
58See the [ICU download page](http://site.icu-project.org/download/) to find the subpage for the current release, including any other changes, bug fixes, known issues, changes to supported platforms and build environments, and migration issues for existing applications migrating from previous ICU releases.
59
60The subpage for the current release will also include an API Change Report, both for ICU4C and ICU4J, for a complete list of APIs added, removed, or changed in this release.
61
62The list of API changes since the previous ICU4J release is available [here](https://htmlpreview.github.io/?https://raw.githubusercontent.com/unicode-org/icu/master/icu4j/APIChangeReport.html).
63
64Changes in previous releases can also be found the main [ICU download page](http://site.icu-project.org/download) in its version-specific subpages.
65
66## License Information
67
68The ICU projects (ICU4C and ICU4J) are hosted by the [Unicode Consortium](http://www.unicode.org/). The ICU binary and source files are distributed under the [UNICODE DATA FILES AND SOFTWARE LICENSE](http://www.unicode.org/copyright.html). The full copy of the license and third party software licenses are available in [LICENSE](https://github.com/unicode-org/icu/blob/master/icu4j/main/shared/licenses/LICENSE) file included in this package.
69
70## Platform Dependencies
71
72The minimum Java runtime version supported by ICU4J 68 is version 7\. Java runtime version 6 is not supported.
73
74ICU4J since version 63 depend on J2SE 7 functionality. Therefore, ICU4J only runs on JRE version 7 or later. ICU4J 68 is tested on JRE 7, 8, 9, 10 and 11.
75
76## How to Download ICU4J
77
78There are a few different ways to download the ICU4J releases.
79
80*   **Official Release:**
81    If you want to use ICU4J (as opposed to developing it), your best bet is to download an official, packaged version of the ICU4J library files. These versions are tested more thoroughly than day-to-day development builds, and they are packaged in jar files for convenient download.
82    *   [ICU Download page](http://www.icu-project.org/download/)
83    *   Maven repository:
84
85~~~
86<dependency>
87    <groupId>com.ibm.icu</groupId>
88    <artifactId>icu4j</artifactId>
89    <version>68.1</version>
90</dependency>
91
92<dependency>
93    <groupId>com.ibm.icu</groupId>
94    <artifactId>icu4j-charset</artifactId>
95    <version>68.1</version>
96</dependency>
97
98<dependency>
99    <groupId>com.ibm.icu</groupId>
100    <artifactId>icu4j-localespi</artifactId>
101    <version>68.1</version>
102</dependency>
103~~~
104
105*   **GitHub Source Repository:**
106    If you are interested in developing features, patches, or bug fixes for ICU4J, you should probably be working with the latest version of the ICU4J source code. You will need to clone and checkout the code from our GitHub repository to ensure that you have the most recent version of all of the files. There are several ways to do this. Please follow the directions that are contained on the [Source Repository page](http://www.icu-project.org/repository/) for details.
107
108For more details on how to download ICU4J directly from the web site, please see the ICU download page at [http://www.icu-project.org/download/](http://www.icu-project.org/download/)
109
110## The Structure and Contents of ICU4J
111
112Below, all directory paths are relative to the directory where the ICU4J source archive is extracted.
113
114### Information and build files
115
116| Path                         | Description                                                                             |
117|------------------------------|-----------------------------------------------------------------------------------------|
118| readme.html                  | A description of ICU4J (International Components for Unicode for Java)                  |
119| build.html                   | The main Ant build file for ICU4J. See [How to Install and Build](#how-to-install-and-build) for more information |
120| main/shared/licenses/LICENSE | ICU license                                                                             |
121
122### ICU4J runtime class files
123
124| Path                    | Sub-component Name | Build Dependencies        | Public API Packages | Description   |
125|-------------------------|--------------------|---------------------------|---------------------|---------------|
126| `main/classes/charset`    | `icu4j-charset`      | `icu4j-core` | `com.ibm.icu.charset` | Implementation of   `java.nio.charset.spi.CharsetProvider`. This sub-component is shipped as `icu4j-charset.jar` along with ICU charset converter data files. |
127| `main/classes/collate`    | `icu4j-collate`      | `icu4j-core` | `com.ibm.icu.text` <br/> `com.ibm.icu.util` | Collator APIs and implementation. Also includes some public API classes that depend on Collator. This sub-component is packaged as a part of `icu4j.jar`. |
128| `main/classes/core`       | `icu4j-core`         | n/a  | `com.ibm.icu.lang` <br/> `com.ibm.icu.math` <br/> `com.ibm.icu.text` <br/> `com.ibm.icu.util` | ICU core API classes and implementation. This sub-component is packaged as a part of `icu4j.jar`. |
129| `main/classes/currdata`   | `icu4j-currdata`     | `icu4j-core` | n/a | No public API classes. Provides access to currency display data. This sub-component is packaged as a part of `icu4j.jar`. |
130| `main/classes/langdata`   | `icu4j-langdata`     | `icu4j-core` | n/a | No public API classes. Provides access to language display data. This sub-component is packaged as a part of `icu4j.jar`. |
131| `main/classes/localespi`  | `icu4j-localespi`    | `icu4j-core` <br/> `icu4j-collate` | n/a | Implementation of various locale-sensitive service providers defined in   `java.text.spi`   and   `java.util.spi`  in J2SE 6.0 or later Java releases. This sub-component is shipped as `icu4j-localespi.jar`. |
132| `main/classes/regiondata` | `icu4j-regiondata`   | `icu4j-core` | n/a | No public API classes. Provides access to region display data. This sub-component is packaged as a part of `icu4j.jar`. |
133| `main/classes/translit`   | `icu4j-translit`     | `icu4j-core` | `com.ibm.icu.text` | Transliterator APIs and implementation. This sub-component is packaged as a part of `icu4j.jar`. |
134
135### ICU4J unit test files
136
137| Path                                      | Sub-component Name              | Runtime Dependencies                                                                                         | Description                                     |
138|-------------------------------------------|---------------------------------|--------------------------------------------------------------------------------------------------------------|-------------------------------------------------|
139| `main/tests/charset`                        | `icu4j-charset-tests`             | `icu4j-charset` <br/> `icu4j-core` <br/> `icu4j-test-framework`                                                                | Test suite for charset sub-component.           |
140| `main/tests/collate`                        | `icu4j-collate-tests`             | `icu4j-collate` <br/> `icu4j-core` <br/> `icu4j-test-framework`                                                                | Test suite for collate sub-component.           |
141| `main/tests/core`                           | `icu4j-core-tests`                | `icu4j-core` <br/> `icu4j-currdata` <br/> `icu4j-langdata` <br/> `icu4j-regiondata` <br/> `icu4j-test-framework`                               | Test suite for core sub-component.              |
142| `main/tests/framework`                      | `icu4j-test-framework`            | `icu4j-core`                                                                                                   | Common ICU4J unit test framework and utilities. |
143| `main/tests/localespi`                      | `icu4j-localespi-tests`           | `icu4j-core` <br/> `icu4j-collate` <br/> `icu4j-currdata` <br/> `icu4j-langdata` <br/> `icu4j-localespi` <br/> `icu4j-regiondata` <br/> `icu4j-test-framework` | Test suite for localespi sub-component.         |
144| `main/tests/packaging` | `icu4j-packaging-tests` | `icu4j-core` <br/> `icu4j-test-framework`                                                                      | Test suite for sub-component packaging.         |
145| `main/tests/translit`                       | `icu4j-translit-tests`            | `icu4j-core` <br/> `icu4j-translit` <br/> `icu4j-test-framework`                                                               | Test suite for translit sub-component.          |
146
147
148
149
150### Others
151
152<table>
153    <tr>
154        <th>Path</th>
155        <th>Description</th>
156    </tr>
157    <tr>
158        <td><code>main/shared</code></td>
159        <td>Files shared by ICU4J sub-components under the <code>main</code> directory including: <ul> <li>ICU4J runtime data archive (icudata.jar).</li> <li>ICU4J unit test data archive (testdata.jar).</li> <li>Shared Ant build script and configuration files.</li> <li>License files.</li></ul> </td>
160    </tr>
161    <tr>
162        <td><code>demos</code></td>
163        <td>ICU4J demo programs.</td>
164    </tr>
165    <tr>
166        <td><code>perf-tests</code></td>
167        <td>ICU4J performance test files.</td>
168    </tr>
169    <tr>
170        <td><code>tools</code></td>
171        <td>ICU4J tools including: <ul> <li>Custom JavaDoc taglets used for generating ICU4J API references.</li> <li>API report tool and data.</li> <li>Other independent utilities used for ICU4J development.</li> </ul></td>
172    </tr>
173    <tr>
174        <td><code>lib</code></td>
175        <td>Folder used for downloading depedency libraries. <br/> <b>Note:</b> ICU4J runtime libraries do not depend on any external libraries other than JDK. These dependencies are for testing (such as JUnit). </td>
176    </tr>
177</table>
178
179## Where to get Documentation
180
181The [ICU user's guide](https://unicode-org.github.io/icu/userguide/) contains lots of general information about ICU, in its C, C++, and Java incarnations.
182
183The complete API documentation for ICU4J (javadoc) is available on the ICU4J web site, and can be built from the sources:
184
185*   [Index to all ICU4J API](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/)
186*   [Charset Detector](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/CharsetDetector.html) – Detection of charset from a byte stream
187*   International Calendars – [Buddhist](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/util/BuddhistCalendar.html), [Chinese](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/util/ChineseCalendar.html), [Coptic](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/util/CopticCalendar.html), [Ethiopic](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/util/EthiopicCalendar.html), [Gregorian](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/util/GregorianCalendar.html), [Hebrew](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/util/HebrewCalendar.html), [Indian](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/util/IndianCalendar.html), [Islamic](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/util/IslamicCalendar.html), [Japanese](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/util/JapaneseCalendar.html), Persian, Dangi.
188*   Time Zone Enhancements – [Time zone transition and rule detection](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/util/BasicTimeZone.html), [iCalendar VTIMEZONE formatting and parsing](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/util/VTimeZone.html), [Custom time zones constructed by user defined rules](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/util/RuleBasedTimeZone.html).
189*   Date Format Enhancements – [Date/Time Pattern Generator](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/DateTimePatternGenerator.html), [Date Interval Format](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/DateIntervalFormat.html), [Duration Format](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/DurationFormat.html).
190*   [Unicode Normalization](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/Normalizer.html) – Canonical text representation for W3C.
191*   [Number Format Enhancements](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/NumberFormat.html) – Scientific Notation, Spelled out.
192*   [Enhanced word-break detection](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/BreakIterator.html) – Rule-based, supports Thai
193*   [Transliteration](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/Transliterator.html) – A general framework for converting text from one format to another, e.g. Cyrillic to Latin, or Hex to Unicode.
194*   Unicode Text [Compression](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/UnicodeCompressor.html) & [Decompression](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/UnicodeDecompressor.html) – 2:1 compression on English Unicode text.
195*   Collation – [Rule-based sorting](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/RuleBasedCollator.html), [Efficient multi-lingual searching](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/StringSearch.html), [Alphabetic indexing](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/AlphabeticIndex.html)
196
197## How to Install and Build
198
199To install ICU4J, simply place the pre-built jar file `icu4j.jar` on your Java `CLASSPATH`. If you need Charset API support please also place `icu4j-charset.jar` on your class path along with `icu4j.jar`.
200
201To build ICU4J, you will need JDK 7 or later (JDK 8 is the reference environment for this release) and the Apache Ant version 1.9 or later. It's recommended to install both the JDK and Ant somewhere _outside_the ICU4J directory. For example, on Linux you might install these in `/usr/local`.
202
203*   Install JDK 8.
204*   Install the [Apache Ant](https://ant.apache.org/) 1.9 or later.
205*   Set environment variables `JAVA_HOME`, `ANT_HOME` and `PATH`, for example:
206
207~~~
208set JAVA_HOME=C:\jdk1.8.0
209set ANT_HOME=C:\apache-ant
210set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;%PATH%
211~~~
212
213Once the JDK and Ant are configured, run the desired target defined in `build.xml`. The default target is `jar` which compiles ICU4J library class files and create ICU4J jar files. For example:
214
215~~~
216C:\icu4j>ant
217Buildfile: C:\icu4j\build.xml
218
219info:
220     [echo] ----- Build Environment Information -------------------
221     [echo] Java Home:    C:\jdk1.8.0\jre
222     [echo] Java Version: 1.8.0_181
223     [echo] Ant Home:     C:\apache-ant
224     [echo] Ant Version:  Apache Ant(TM) version 1.10.1 compiled on February 2 2017
225     [echo] OS:           Windows 10
226     [echo] OS Version:   10.0
227     [echo] OS Arch:      amd64
228     [echo] Host:         ICUDEV
229     [echo] -------------------------------------------------------
230
231core:
232
233@compile:
234     [echo] build-local:     ../../shared/../../build-local.properties
235     [echo] --- java compiler arguments ------------------------
236     [echo] source dir:     C:\icu4j\main\classes\core/src
237     [echo] output dir:     C:\icu4j\main\classes\core/out/bin
238     [echo] bootclasspath:
239     [echo] classpath:
240     [echo] source:         1.7
241     [echo] target:         1.7
242     [echo] debug:          on
243     [echo] encoding:       UTF-8
244     [echo] compiler arg:   -Xlint:all,-deprecation,-dep-ann,-options,-overrides
245     [echo] ----------------------------------------------------
246    [mkdir] Created dir: C:\icu4j\main\classes\core\out\bin
247    [javac] Compiling 470 source files to C:\icu4j\main\classes\core\out\bin
248    [javac] Note: Some input files use or override a deprecated API.
249    [javac] Note: Recompile with -Xlint:deprecation for details.
250
251compile:
252
253@copy:
254     [copy] Copying 24 files to C:\icu4j\main\classes\core\out\bin
255
256set-icuconfig-datapath:
257
258copy-data:
259    [unjar] Expanding: C:\icu4j\main\shared\data\icudata.jar into C:\icu4j\main\
260classes\core\out\bin
261    [unjar] Expanding: C:\icu4j\main\shared\data\icutzdata.jar into C:\icu4j\mai
262n\classes\core\out\bin
263
264...
265...
266...
267
268localespi:
269
270@compile:
271     [echo] build-local:     ../../shared/../../build-local.properties
272     [echo] --- java compiler arguments ------------------------
273     [echo] source dir:     C:\icu4j\main\classes\localespi/src
274     [echo] output dir:     C:\icu4j\main\classes\localespi/out/bin
275     [echo] bootclasspath:
276     [echo] classpath:      C:\icu4j\main\classes\core\out\lib\icu4j-core.jar;C:
277\icu4j\main\classes\collate\out\lib\icu4j-collate.jar
278     [echo] source:         1.7
279     [echo] target:         1.7
280     [echo] debug:          on
281     [echo] encoding:       UTF-8
282     [echo] compiler arg:   -Xlint:all,-deprecation,-dep-ann,-options
283     [echo] ----------------------------------------------------
284    [mkdir] Created dir: C:\icu4j\main\classes\localespi\out\bin
285    [javac] Compiling 22 source files to C:\icu4j\main\classes\localespi\out\bin
286
287compile:
288
289@copy:
290     [copy] Copying 11 files to C:\icu4j\main\classes\localespi\out\bin
291
292copy:
293
294@jar:
295    [mkdir] Created dir: C:\icu4j\main\classes\localespi\out\lib
296     [copy] Copying 1 file to C:\icu4j\main\classes\localespi\out
297      [jar] Building jar: C:\icu4j\main\classes\localespi\out\lib\icu4j-localesp
298i.jar
299
300jar:
301
302@src-jar:
303      [jar] Building jar: C:\icu4j\main\classes\localespi\out\lib\icu4j-localesp
304i-src.jar
305
306src-jar:
307
308build:
309
310jar:
311     [copy] Copying 1 file to C:\icu4j
312     [copy] Copying 1 file to C:\icu4j
313
314BUILD SUCCESSFUL
315Total time: 30 seconds
316~~~
317
318> :point_right: **Note**:  The above output is an example. The numbers are likely to be different with the current version ICU4J.
319
320The following are some targets that you can provide to `ant`. For more targets run `ant -projecthelp` or see the build.xml file.
321
322
323
324
325
326| **jar (default)** | Create ICU4J runtime library jar archives (`icu4j.jar`, `icu4j-charset.jar` and `icu4j-localespi.jar`) in the root ICU4J directory. |
327| **check**         | Build all ICU4J runtime library classes and corresponding unit test cases, then run the tests.                                      |
328| **clean**         | Remove all build output files.                                                                                                      |
329| **main**          | Build all ICU4J runtime library sub-components (under the directory `main/classes`).                                                |
330| **tests**         | Build all ICU4J unit test sub-components (under the directory `main/tests`) and their dependencies.                                 |
331| **tools**         | Build the tools.                                                                                                                    |
332| **docs**          | Run javadoc over the ICU4J runtime library files, generating an HTML documentation tree in the subdirectory `doc`.                  |
333| **jarDocs**       | Create ICU4J doc jar archive (`icu4jdocs.jar`) containing API reference docs in the root ICU4J directory.                           |
334| **jarDemos**      | Create ICU4J demo jar archive (`icu4jdemos.jar`) in the root ICU4J directory.                                                       |
335
336For more information, read the Ant documentation and the **build.xml** file.
337
338> :point_right: **Note**: If you get an OutOfMemoryError when you are running <tt>"ant check"</tt>, you can set the heap size of the jvm by setting the environment variable JVM_OPTIONS to the appropriate java options.
339
340> :point_right: **Note**: **Eclipse users:** See the ICU4J site for information on [how to configure Eclipse](http://site.icu-project.org/setup/eclipse) to build and develop ICU4J on Eclipse IDE.
341
342> :point_right: **Note**: To install and configure ICU4J Locale Service Provider, please refer the user guide page [ICU4J Locale Service Provider](https://unicode-org.github.io/icu/userguide/icu4j-locale-service-provider).
343
344## Trying Out ICU4J
345
346> :point_right: **Note**: the demos provided with ICU4J are for the most part undocumented. This list can show you where to look, but you'll have to experiment a bit. The demos are **unsupported** and may change or disappear without notice.
347
348The icu4j.jar file contains only the ICU4J runtime library classes, not the demo classes, so unless you build ICU4J there is little to try out.
349
350### Charset
351
352To try out the **Charset** package, build **icu4j.jar** and **icu4j-charset.jar** using the `jar` target. You can use the charsets by placing these files on your classpath.
353
354~~~
355java -cp $icu4j_root/icu4j.jar:$icu4j_root/icu4j-charset.jar <your program>
356~~~
357
358### Other demos
359
360The other demo programs are **not supported** and exist only to let you experiment with the ICU4J classes. First, build ICU4J using `ant jarDemos`. Then launch the demos as below:
361
362~~~
363java -jar $icu4j_root/icu4jdemos.jar
364~~~
365
366## ICU4J Resource Information
367
368Starting with release 2.1, ICU4J includes its own resource information which is completely independent of the JRE resource information. (Note, ICU4J 2.8 to 3.4, time zone information depends on the underlying JRE). The ICU4J resource information is equivalent to the information in ICU4C and many resources are, in fact, the same binary files that ICU4C uses.
369
370By default the ICU4J distribution includes all of the standard resource information. It is located under the directory com/ibm/icu/impl/data. Depending on the service, the data is in different locations and in different formats.
371
372> :point_right: **Note**: This will continue to change from release to release, so clients should not depend on the exact organization of the data in ICU4J.
373
374*   The primary **locale data** is under the directory `icudt68b`, as a set of `".res"` files whose names are the locale identifiers. Locale naming is documented the `com.ibm.icu.util.ULocale` class, and the use of these names in searching for resources is documented in `com.ibm.icu.util.UResourceBundle`.
375*   The **break iterator data** is under the directory `icudt68b/brkitr`, as a set of `".res"`, `".brk"` and `".dict"` files.
376*   The **collation data** is under the directory `icudt68b/coll`, as a set of `".res"` files.
377*   The **currency display name data** is under the directory `icudt68b/curr`, as a set of `".res"` files.
378*   The **language display name data** is under the directory `icudt68b/lang`, as a set of `".res"` files.
379*   The **rule-based number format data** is under the directory `icudt68b/rbnf`, as a set of `".res"` files.
380*   The **region display name data** is under the directory `icudt68b/region`, as a set of `".res"` files.
381*   The **rule-based transliterator data** is under the directory `icudt68b/translit`, as a set of `".res"` files.
382*   The **measurement unit data** is under the directory `icudt68b/unit`, as a set of `".res"` files.
383*   The **time zone display name data** is under the directory `icudt68b/zone`, as a set of `".res"` files.
384*   The **character property data** and default **unicode collation algorithm (UCA) data** is found under the directory `icudt68b`, as a set of `".icu"` files.
385*   The **normalization data** is found under the directory `icudt68b`, as a set of `".nrm"` files.
386*   The **character set converter data** is under the directory `icudt68b`, as a set of `".cnv"` files. These files are currently included only in icu-charset.jar.
387*   The **time zone rule data** is under the directory `icudt68b`, as `zoneinfo64.res`.
388*   The **holiday data** is under the directory `icudt68b`, as a set of `".class"` files, named `"HolidayBundle_"` followed by the locale ID.
389
390Some of the data files alias or otherwise reference data from other data files. One reason for this is because some locale names have changed. For example, `he_IL` used to be `iw_IL`. In order to support both names but not duplicate the data, one of the resource files refers to the other file's data. In other cases, a file may alias a portion of another file's data in order to save space. Currently ICU4J provides no tool for revealing these dependencies.
391
392> :point_right: **Note**: Java's `Locale` class silently converts the language code `"he"` to `"iw"` when you construct the Locale (for versions of Java through Java 5). Thus Java cannot be used to locate resources that use the `"he"` language code. ICU, on the other hand, does not perform this conversion in ULocale, and instead uses aliasing in the locale data to represent the same set of data under different locale ids.
393
394Resource files that use locale ids form a hierarchy, with up to four levels: a root, language, region (country), and variant. Searches for locale data attempt to match as far down the hierarchy as possible, for example, `"he_IL"` will match `he_IL`, but `"he_US"` will match `he` (since there is no `US` variant for he, and `"xx_YY` will match root (the default fallback locale) since there is no `xx` language code in the locale hierarchy. Again, see `java.util.ResourceBundle` for more information.
395
396**Currently ICU4J provides no tool for revealing these dependencies** between data files, so trimming the data directly in the ICU4J project is a hit-or-miss affair. The key point when you remove data is to make sure to remove all dependencies on that data as well. For example, if you remove `he.res`, you need to remove `he_IL.res`, since it is lower in the hierarchy, and you must remove iw.res, since it references `he.res`, and `iw_IL.res`, since it depends on it (and also references `he_IL.res`).
397
398Unfortunately, the jar tool in the JDK provides no way to remove items from a jar file. Thus you have to extract the resources, remove the ones you don't want, and then create a new jar file with the remaining resources. See the jar tool information for how to do this. Before 'rejaring' the files, be sure to thoroughly test your application with the remaining resources, making sure each required resource is present.
399
400### Using additional resource files with ICU4J
401
402> :warning: **Warning: Resource file formats can change across releases of ICU4J!**
403>
404> The format of ICU4J resources is not part of the API. Clients who develop their own resources for use with ICU4J should be prepared to regenerate them when they move to new releases of ICU4J.
405
406
407We are still developing ICU4J's resource mechanism. Currently it is not possible to mix icu's new binary `.res` resources with traditional java-style `.class` or `.txt` resources. We might allow for this in a future release, but since the resource data and format is not formally supported, you run the risk of incompatibilities with future releases of ICU4J.
408
409Resource data in ICU4J is checked in to the repository as a jar file containing the resource binaries, `$icu4j_root/main/shared/data/icudata.jar`. This means that inspecting the contents of these resources is difficult. They currently are compiled from ICU4C `.txt` file data. You can view the contents of the ICU4C text resource files to understand the contents of the ICU4J resources.
410
411The files in `icudata.jar` get extracted to `com/ibm/icu/impl/data` in the build output directory by some build targets.
412
413### Building ICU4J Resources from ICU4C
414
415ICU4J data is built by ICU4C tools. Please see [`icu4j-readme.txt`](https://github.com/unicode-org/icu/blob/master/icu4c/source/data/icu4j-readme.txt) in `icu4c/source/data` for the procedures.
416
417#### Generating Data from CLDR
418
419> :point_right: **Note**: This procedure assumes that all 3 sources are present
420
421> :point_right: **Note**: The following example was written using the example of the CLDR 38 release which was released in conjunction with the ICU 68.1 release
422
4231.  Checkout or download CLDR version `release-38`
4242.  Checkout ICU with tag `release-68-1`
4253.  cd to icu4c/source/data directory
4264.  Follow the instructions in [`icu4c/source/data/cldr-icu-readme.txt`](https://github.com/unicode-org/icu/blob/master/icu4c/source/data/cldr-icu-readme.txt)
4275.  Rebuild ICU4C with the newly generated data.
4286.  Run ICU4C tests to verify that the new data is good.
4297.  Build ICU4J data from ICU4C data by following the procedures in [`icu4j/source/data/icu4j-readme.txt`](https://github.com/unicode-org/icu/blob/master/icu4c/source/data/icu4j-readme.txt)
4308.  cd to `icu4j` dir
4319.  Build and test icu4j
432
433## About ICU4J Time Zone
434
435ICU4J library includes the latest time zone data, as of the release date. However, time zone data is frequently updated in response to changes made by local governments around the world. If you need to update the time zone data, please refer the ICU user guide topic [Updating the Time Zone Data](https://unicode-org.github.io/icu/userguide/datetime/timezone#updating-the-time-zone-data).
436
437You can optionally configure ICU4J date and time service classes to use underlying JDK TimeZone implementation (see the ICU4J API reference [TimeZone](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/util/TimeZone.html) for the details). When this configuration is enabled, ICU's own time zone data won't be used and you have to get time zone data patches from the JRE vendor.
438
439## Where to Find More Information
440
441[http://www.icu-project.org/](http://www.icu-project.org/) is the home page of International Components for Unicode development project
442
443## Submitting Comments, Requesting Features and Reporting Bugs
444
445Your comments are important to making ICU4J successful. We are committed to investigate any bug reports or suggestions, and will use your feedback to help plan future releases.
446
447To submit comments, request features and report bugs, please see [ICU bug database information](http://site.icu-project.org/bugs) or contact us through the [ICU Support mailing list](http://site.icu-project.org/contacts). While we are not able to respond individually to each comment, we do review all comments.
448
449## Thank you for your interest in ICU4J!
450
451* * *
452
453© 2016 and later: Unicode, Inc. and others.
454License & terms of use: [http://www.unicode.org/copyright.html](http://www.unicode.org/copyright.html)