Error building QuPath with tensorflow "first number in a CFBundleVersion cannot be zero or negative"

Hi all again,

following yesterday’s smart advice, I am trying to add StarDist directly to QuPath, which requires building QuPath rather than using the ready-made app.

After cloning the repo (commit 901911fa7e2afece6c7732459027fa6fc6e5dea5 for sake of future reproducibility), I run ./gradlew clean build createPackage -Ptensorflow-cpu=true -Ppackager=/Library/Java/JavaVirtualMachines/adoptopenjdk-15.jdk/Contents/Home/bin/jpackage (the build would previously stop because I wasn’t passing the -pPackager argument).

The process stops at

> Task :createPackage FAILED
/Library/Java/JavaVirtualMachines/adoptopenjdk-15.jdk/Contents/Home/bin/jpackage --input /Users/stefano/qupath/build/qupath --dest /Users/stefano/qupath/build/dist --main-jar qupath-0.2.3.jar --name QuPath-0.2.3 --java-options -XX:MaxRAMPercentage=50 --mac-package-name QuPath --mac-package-identifier QuPath --type app-image --app-version 0.2.3 --icon /Users/stefano/qupath/build/resources/main/package/macosx/qupath.icns --file-associations /Users/stefano/qupath/build/resources/main/package/associations/project.properties --runtime-image /Users/stefano/qupath/build/jre
WARNING: Using incubator modules: jdk.incubator.jpackage
Bundler Mac Application Image skipped because of a configuration problem: The first number in a CFBundleVersion cannot be zero or negative. 
Advice to fix: Set a compatible 'appVersion' or set a 'mac.CFBundleVersion'. Valid versions are one to three integers separated by dots.

It’s a problem I haven’t seen happening to others, although it seems related to xcode? and I unfortunately didn’t manage to figure out how to follow the “Advice to fix”… I actually tried to cheat my way through this by changing the content of qupath/VERSION from 0.2.3 to 1.2.3 to satisfy the “no 0 as first number” and, while the build successfully got to a conclusion, the resulting app would refuse to open.

Thanks again in advance!

jpackage changed in OpenJDK 15, so you’ll need to use OpenJDK 14 for it to work properly. Some more info here (basically, it seems to be subtly broken on all platforms in different ways…).

We haven’t updated the build script, because OpenJDK 16 is on the horizon, and it should (I believe) have a stable jpackage at that point. We’re also working towards the next QuPath 0.x release.

So rather than switch twice, we’re sticking with ‘use OpenJDK 14 if you want to build QuPath v0.2.x’ as a consistent rule, and use OpenJDK 16+ for future, as-yet-unreleased QuPath versions.

1 Like

aaand that did the trick! Thank you :slight_smile:

1 Like