Broken -Bmac.CFBundleVersion parameter in javapackager

On macOS, the command line parameter -Bmac.CFBundleVersion=<value>

specified in the Oracle utility documentationjavapackager

does not work.

I am using the following command to create a disk image Application.app

from Application.jar

:

javapackager \
  -deploy \
  -native image \
  -srcfiles Application.jar \
  -outdir dist \
  -outfile Application \
  -appclass Application \
  -BappVersion=2.0 \
  -Bmac.CFBundleVersion=2.0.0 \
  -BjvmOptions=-Dapple.laf.useScreenMenuBar=true

      

A pop-up window opened from the About App item in the menu bar displays the following line:

Application

Version 2.0 (100)

      

instead

Application

Version 2.0 (2.0.0)

      

When I check the generated file Application.app/Contents/Info.plist

, I see that I javapackager

read the command line parameter correctly -BappVersion=2.0

to set the key value CFBundleShortVersionString

, but could not read the command line parameter -Bmac.CFBundleVersion=2.0.0

to set the key value CFBundleVersion

:

<key>CFBundleShortVersionString</key>
<string>2.0</string>
<key>CFBundleVersion</key>
<string>100</string>

      

+3


source to share


1 answer


I was using an old version (Update 25) of Java SE Development Kit 8. I downloaded and installed the latest version (Update 121) from Oracle website (jdk-8u121-macosx-x64.dmg) and it solved the problem. Thanks @Nicolas Filotto.



0


source







All Articles