Skip to content

Instantly share code, notes, and snippets.

Last active Dec 13, 2019
What would you like to do?
Run OpenLabeler with system Java

OpenLabeler is a pretty nice image annotation package, but I had issues getting it to run. Plus I'd rather use the system-supplied Java environment, instead of a bundled one, and install it for a user (not in the system).

This happens on a Debian or Ubuntu system (with apt and deb tools available).

  1. Download deb package of latest release.
  2. Extract its contents: dpkg-deb -x ~/.local/openlabeler openlabeler-1.2.0.deb
  3. Make sure you have OpenJDK 11 installed plus apt install libopenjdk-11-jre libopenjfx-java
  4. Cleanup directory structure: cd ~/.local/openlabeler && mv opt/OpenLabeler/* . && rmdir opt/OpenLabeler opt
  5. Move to the same directory, and symlink it from e.g. ~/.local/bin/openlabeler
  6. Remove the OpenLabeler-bundled Java runtime: rm -Rf ~/.local/openlabeler/runtime (it's 500MB!)
BASE=$(cd `dirname "$0"` && pwd)
# construct classpath
LIBJARS=`sed 's/^app\.classpath=//p;d' < "$CFG"`
LIBJARS="$BASE/app/"`echo "$LIBJARS" | sed -E "s|:|:$BASE/app/|g"`
MAINJAR="$BASE/app/"`sed 's/^app\.mainjar=//p;d' < "$CFG"`
# get main class (need dots instead of slashes to run)
MAINCLS=`sed 's/^app\.mainclass=//p;d' < "$CFG"`
MAINCLS=`echo "$MAINCLS" | sed 's/\//./g'`
# we also need system JavaFX
if [ ! -e /usr/share/java/javafx-base.jar ]; then
echo "Please: apt-get install libopenjfx-java" 1>&2
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment