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

jpackage does not work if class file has `$$` in the name on windows

XMLWordPrintable

    • b22
    • x86_64
    • windows_10

        ADDITIONAL SYSTEM INFORMATION :
        java 17, windows 10

        A DESCRIPTION OF THE PROBLEM :
        First, apologies if this is in the wrong place. I'm unfamilar with the jdk ecosystem and it doesn't seem like other repositories have issue trackers. If this is the wrong place, please point me in the right direction :pray:


        This was seen on

        ![Screenshot from 2022-02-22 11-16-20](https://user-images.githubusercontent.com/3514957/155183799-7f74c11d-89ed-4066-9126-e0ba858aad23.png)


        If you package up an application that has `$$` in the class file this will not work with `wix` (the tool used to generate an `msi` file on windows).

        This is because the wix pre-processor parses `$$` as a _single_ escaped `$`.

        ![Screenshot from 2022-02-22 07-48-02](https://user-images.githubusercontent.com/3514957/155182083-04903556-ccc6-4a03-bd68-2bc1dc7f55a3.png)
        ![Screenshot from 2022-02-22 07-47-27](https://user-images.githubusercontent.com/3514957/155182087-e21b3a94-002f-4a58-abab-1a0bf141290a.png)


        for more information see

        - https://github.com/bitcoin-s/bitcoin-s/issues/4116
        - https://github.com/wixtoolset/issues/issues/6734
        - https://stackoverflow.com/questions/67494578/jpackage-on-windows-the-system-cannot-find-file-error-103/71225242#71225242

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Try to package something with `jpackage` on windows that contains a class file with `$$` in the file name

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        It automatically escapes the `$$` the wix pre-processor requires, see: https://github.com/wixtoolset/issues/issues/6734
        ACTUAL -
        File not found due to wix dropping a `$` in the file name. The result files wix searches have incorrect file names due to `$` missing.

        For example, this is the error message i see

        C:\Users\runneradmin\AppData\Local\Temp\jdk.jpackage10810086746577514793\config\bundle.wxf(1578) : error LGHT0103 : The system cannot find the file 'C:\Users\RUNNER~1\AppData\Local\Temp\jdk.jpackage10810086746577514793\images\win-msi.image\BundleGUI\app\classes\org\bitcoins\bundle\gui\NeutrinoConfigPane$anon$7.class'

        and the real file name is

        NeutrinoConfigPane$$anon$7.class


        ---------- BEGIN SOURCE ----------
        see: https://github.com/bitcoin-s/bitcoin-s/tree/2022-02-21-windows-jpackage

        and the file that actually tries to use jpackage and build an msi

        https://github.com/bitcoin-s/bitcoin-s/blob/7adb862775c3a5bee1cb9b4f2605258e5076d354/.github/workflows/release.yml#L162
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        No known workaround at this time.

        FREQUENCY : always


          1. log.txt
            19 kB
            Anupam Dev

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

                Created:
                Updated:
                Resolved: