macOS

Tested using Amazon Corretto JDK on an M1 MacBook Air.

Java version when tested:

% java --version
openjdk 17.0.2 2022-01-18 LTS
OpenJDK Runtime Environment Corretto-17.0.2.8.1 (build 17.0.2+8-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.2.8.1 (build 17.0.2+8-LTS, mixed mode, sharing)
  1. Create a working folder.
  2. Download the ZIP distribution of the version of BaseX that you would like to use.
  3. Unzip the archive so you have the basex folder.
  4. Remove the .basex configuration files from the folder to ensure that each user gets a personal file generated automatically:
    % rm ./basex/.basex*
  5. Create a new file basex-config.cfg in your working folder and add the content. Remember to change the app-version to your selected version:
    [Application]
    app.classpath=$APPDIR/BaseX.jar
    app.mainclass=org.basex.BaseXGUI
    app.classpath=$APPDIR/lib/*
    app.classpath=$APPDIR/lib/custom/*
    
    [JavaOptions]
    java-options=-Djpackage.app-version=11.0
  6. If you would like to include some custom libraries in the build, add them to the folder in basex/lib/custom.
  7. Add a basex.icns file to your working folder.
  8. Run the command to make a .dmg disk image of BaseX. Remember to set the app version to match your selected version:
  9. jpackage --input target/ \
      --input basex \
      --name "BaseX" \
      --main-jar BaseX.jar \
      --main-class org.basex.BaseXGUI \
      --type dmg \
      --icon "basex.icns" \
      --app-version "11.0" \
      --vendor "BaseX GmbH" \
      --copyright "Copyright 2024 BaseX GmbH" \
      --mac-package-name "BaseX" \
      --module-path "lib" \
      --verbose
  10. A disk image will be created in your working folder. Open it, and you can copy the application to your Applications folder or any chosen location.
  11. Optional: If you want to add custom libraries later, show the package contents of the application. Replace the content of the file BaseX {version}.cfg with the original from step 5. Now you can add and remove libraries, and they will be loaded/unloaded with application restart.

⚡Generated with XQuery