To get ICU4J running in VSCode, including JUnit support:
vscjava.vscode-java-pack
)"java.project.resourceFilters"
. This will prevent the extension from dirtying your .project files in later steps:"java.project.resourceFilters": [ ]
Run ant init
in the icu4j
directory
Create a new workspace and add each of the following directories to it:
icu4j/main/classes/*
(all directories at that path)icu4j/main/tests/*
(all directories at that path)icu4j/tools/misc
Modify all of the icu4j/main/tests/.classpath
files as follows:
/external-libraries/
to ../../../lib/
.classpathentry
s for the data jar files.For example:
<!-- Before --> <classpathentry kind="lib" path="/external-libraries/hamcrest-core-1.3.jar"/> <classpathentry kind="lib" path="/external-libraries/junit-4.12.jar" sourcepath="/external-libraries/junit-4.12-sources.jar"> <attributes> <attribute name="javadoc_location" value="jar:platform:/resource/external-libraries/junit-4.12-javadoc.jar!/"/> </attributes> </classpathentry> <classpathentry kind="lib" path="/external-libraries/JUnitParams-1.0.5.jar" sourcepath="/external-libraries/JUnitParams-1.0.5-sources.jar"> <attributes> <attribute name="javadoc_location" value="jar:platform:/resource/external-libraries/JUnitParams-1.0.5-javadoc.jar!/"/> </attributes> </classpathentry> <!-- After --> <classpathentry kind="lib" path="../../../lib/hamcrest-core-1.3.jar"/> <classpathentry kind="lib" path="../../../lib/junit-4.12.jar" sourcepath="../../../lib/junit-4.12-sources.jar"> <attributes> <attribute name="javadoc_location" value="jar:platform:/resource/../../../lib/junit-4.12-javadoc.jar!/"/> </attributes> </classpathentry> <classpathentry kind="lib" path="../../../lib/JUnitParams-1.0.5.jar" sourcepath="../../../lib/JUnitParams-1.0.5-sources.jar"> <attributes> <attribute name="javadoc_location" value="jar:platform:/resource/../../../lib/JUnitParams-1.0.5-javadoc.jar!/"/> </attributes> </classpathentry> <classpathentry kind="lib" path="../../shared/data/icudata.jar"/> <classpathentry kind="lib" path="../../shared/data/icutzdata.jar"/> <classpathentry kind="lib" path="../../shared/data/testdata.jar"/>
.classpath
from accidentally being committed, you can run:$ git update-index --assume-unchanged main/tests/*/.classpath
org.eclipse.jdt.core.prefs
files, you can ignore those, too:$ git update-index --assume-unchanged main/classes/*/.settings/org.eclipse.jdt.core.prefs $ git update-index --assume-unchanged main/tests/*/.settings/org.eclipse.jdt.core.prefs $ git update-index --assume-unchanged tools/misc/.settings/org.eclipse.jdt.core.prefs
*.java
file, and you should see a double-right triangle, which you can click to run the test.Other tips:
Shift + Ctrl + P
on Linux) and search for “Java: Rebuild Projects”