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

UTF-8 argfiles with umlauts are not working

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      ADDITIONAL SYSTEM INFORMATION :
      Windows 11,
      Java 21 (Temurin)

      A DESCRIPTION OF THE PROBLEM :
      When the classpath argument of in an argfile contains umlauts (üäö, and probably other special characters too), the classpath is not working.

      In my case, my name contains an umlaut (Mücke) and so does my Windows profile name and the folder to my profile (C:\Users\GeraldMücke).
      To shorten the command line, Intellij generates an argfile that where a lot of jars are located underneath my profile (maven repository, build artifacts, IDEA artifacts) and so I get ClassNotFoundExceptions.



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      can be easily reproduced by
      1. create an argile with a -classpath argument that contains umlaut (path or jar)
      2. run java with this argfile (java @argfile)

      The argfile has to be utf-8 encoded

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      UTF-8 encoded argfiles with classpath containing umlauts work properly
      ACTUAL -
      UTF-8 encoded argfiles with classpath containing umlauts produce ClassNotFoundException

      ---------- BEGIN SOURCE ----------
      https://github.com/gmuecke/umlaut_argfile_reproducer
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      - convert the argfile to ISO-8859-1 (not feasible in case of IntellJ)
      - rename profile path and change profile in Windows (cumbersome and errorprone)

      FREQUENCY : always


      Attachments

        Activity

          People

            cstein Christian Stein
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: