import java.nio.charset.Charset;
import java.util.Map;
import java.util.SortedMap;
public class CharsetLister {
public static void main(String[] args) {
SortedMap<String, Charset> cs = Charset.availableCharsets();
for (Map.Entry<String, Charset> e : cs.entrySet()) {
System.out.printf("%s=%s%n", e.getKey(), e.getValue().toString());
}
}
}
We can now create a module using the class files now in our output directory ('charsets'):
So we now do the packaging. The --dest argument tells us where we want the installer to end up, and here we want an MSI type of installer. We need to specify that the program will be a console program we want to be able to choose the installation directory and we point the installer at the module using the --module-path and we tell the packager which module and main class we want to form the executable.
As you can see, if we list the 'jpk' directory we see the finished installer.
We can run the installer and install the software:
Let's temporarily set the PATH variable so we can run the software as an installed program. You would normally do this as a permanent thing by setting the PATH through System in Environment Variables.
Now we've done that, we can run it using its executable name of CharsetLister(.exe). We here reduce the output by constraining it to contain only those entries with the substring "IBM".