Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8270271

Different output of the available charsets between full JDK and minimum JRE.

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      The output of the available charsets by full JDK differs the output of the one by minimum JRE made by jlink command. The latter is proper subset of the former.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      step1. attached program runs on full JDK16.0.1.
      step2. make minimum JRE by the next command.
          $ jlink --compress=2 --module-path="/Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home/jmods/" --add-modules java.base --output jre-min
      step3. attached program runs on minimum JRE
      step4. Compare outputs by step1 and step3

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I want to get the same output by the step1 and step3.
      ACTUAL -
      The output of charsets by the step3 is smaller than step1.

      ---------- BEGIN SOURCE ----------
      import java.nio.charset.Charset;
      import java.util.Iterator;
      import java.util.Set;
      import java.util.SortedMap;

      public class CharsetTest {

      public static void main(String[] args) {
      SortedMap<String, Charset> map = Charset.availableCharsets();
      Set<String> keys = map.keySet();
      Iterator<String> ite = keys.iterator();
      while (ite.hasNext()) {
      String charset = ite.next();
      System.out.println(charset);
      }
      }
      }

      ---------- END SOURCE ----------

      FREQUENCY : always


        1. jdk_charset.txt
          4 kB
        2. jlink_charset.txt
          1 kB
        3. Test.java
          0.4 kB

            naoto Naoto Sato
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: