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

jpackage utility creates an "infinite", undeleteable directory tree

XMLWordPrintable

    • b23
    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10 / Java SDK 21

      A DESCRIPTION OF THE PROBLEM :
      Under certain conditions, such as setting a --temp directory that is a subdirectory of the input directory, including the path in the --main-jar parameter, or setting the --i and --d directories to the same value, jpackage will recurse infinitely, creating an extremely deep directory structure that's difficult to delete on Windows machines. The software should reasonably check if this is going to happen and print out an appropriate error message.

      See the discussion at https://stackoverflow.com/questions/69412663/jpackage-doesnt-generate-working-exe-and-bugs-folders.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run jpackage using any of the three conditions listed in the description.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      jpackage prints, e.g., a "The --i directory cannot be the same as the --d directory" error and exits without action.
      ACTUAL -
      The software eventually crashes with a "java.io.IOException: Cannot access file with path exceeding 32000 characters" error and an undeletable folder tree is created. Hence, be careful.

      ---------- BEGIN SOURCE ----------
      Any executable JAR file will work.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Carefully avoid any of the conditions that create the explosion.

      FREQUENCY : always


            asemenyuk Alexey Semenyuk
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: