Project > Open, is broken on Manjaro KDE Linux

I’ve been using GanttProject for years, even paid for it (more than twice). Suddenly I can no longer open my files.

The problem is at the interface level. I click Project, Open, and I get a broken looking “Open Project” page. Clicking “Open Other Project” does nothing.

The other problem is “Save” seems to not work, but the Save dialogue has actually popped up underneath in the background - I have to move the main window to see it. But this is not the case for the Open dialogue. So I can make new files and save them, but I can’t open existing files…

Here is my system info:

Operating System: Manjaro Linux
KDE Plasma Version: 5.21.2
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Kernel Version: 5.9.16-1-MANJARO
OS Type: 64-bit
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-6700K CPU @ 4.00GHz
Memory: 31.3 GiB of RAM
Graphics Processor: GeForce RTX 2060 SUPER/PCIe/SSE2

Hello,
what is in the log when it happens? Help > View log

It looks like it doesn’t change after the program starts. No new messages are posted to the log after I click Project > Open, nor clicking the “Open Other Project” button.

/home/domarius/.ganttproject.d/logs/.ganttproject-20210317102818.log

GanttProject 3.0.3004
Settings file:
	location: /home/domarius/.ganttproject
	size:4478
	is readable: true
java.class.path: :/opt/ganttproject/eclipsito.jar
java.home: /usr/lib/jvm/java-15-openjdk
java.ext.dirs: null
java.io.tmpdir: /tmp
java.runtime.version: 15.0.2+7
java.vendor: N/A
java.vm.name: OpenJDK 64-Bit Server VM
java.vm.vendor: Oracle Corporation
java.vm.version: 15.0.2+7
os.arch: amd64
os.name: Linux
os.version: 5.9.16-1-MANJARO
sun.java.command: com.bardsoftware.eclipsito.Launch --verbosity 1 --version-dirs /opt/ganttproject/plugins:~/.ganttproject.d/updates --app net.sourceforge.ganttproject.GanttProject -log true -log_file /home/domarius/.ganttproject.d/logs/.ganttproject-20210317102818.log
user.country: AU
user.dir: /home/domarius
user.home: /home/domarius
user.language: en
user.timezone: Australia/Brisbane

Mar 17, 2021 12:28:20 AM net.sourceforge.ganttproject.GPLogger log
INFO: Deleting old auto-save files
Mar 17, 2021 12:28:21 AM net.sourceforge.ganttproject.GPLogger log
INFO: Starting RSS check...
Mar 17, 2021 12:28:24 AM net.sourceforge.ganttproject.GPLogger log
INFO: RSS check finished
Mar 17, 2021 12:28:24 AM net.sourceforge.ganttproject.GPLogger log
INFO: [GanttOptions] save(): finished!!

Can you please try using BellSoft Liberica Java Runtime version 11 with JavaFX? This is known as “Full JRE” option on their download page.

I actually managed to install it via Manjaro’s package manager, but I still get the bug in the above screenshot, and the log output still looks like it’s using the wrong version of Java. Not sure what to do… never been sure what to do with .tar.gz downloads, if you don’t have any advice I’ll try to look into it myself again…

/home/domarius/.ganttproject.d/logs/.ganttproject-20210320000527.log

GanttProject 3.0.3004
Settings file:
	location: /home/domarius/.ganttproject
	size:4478
	is readable: true
java.class.path: :/opt/ganttproject/eclipsito.jar
java.home: /usr/lib/jvm/java-15-openjdk
java.ext.dirs: null
java.io.tmpdir: /tmp
java.runtime.version: 15.0.2+7
java.vendor: N/A
java.vm.name: OpenJDK 64-Bit Server VM
java.vm.vendor: Oracle Corporation
java.vm.version: 15.0.2+7
os.arch: amd64
os.name: Linux
os.version: 5.9.16-1-MANJARO
sun.java.command: com.bardsoftware.eclipsito.Launch --verbosity 1 --version-dirs /opt/ganttproject/plugins:~/.ganttproject.d/updates --app net.sourceforge.ganttproject.GanttProject -log true -log_file /home/domarius/.ganttproject.d/logs/.ganttproject-20210320000527.log
user.country: AU
user.dir: /home/domarius
user.home: /home/domarius
user.language: en
user.timezone: Australia/Brisbane

Mar 19, 2021 2:05:29 PM net.sourceforge.ganttproject.GPLogger log
INFO: Deleting old auto-save files
Mar 19, 2021 2:05:30 PM net.sourceforge.ganttproject.GPLogger log
INFO: Starting RSS check...
Mar 19, 2021 2:05:33 PM net.sourceforge.ganttproject.GPLogger log
INFO: RSS check finished
Mar 19, 2021 2:05:33 PM net.sourceforge.ganttproject.GPLogger log
INFO: [GanttOptions] save(): finished!!
export JAVA_HOME=/path/to/your/java11/runtime/root
ganttproject

See this article for details: Installing from ZIP · bardsoftware/ganttproject Wiki · GitHub
It refers to GP 2.8.+ but the process for GP 3.0 is the same.

For the record, I don’t claim that Java 15 is wrong in any way. In fact, GanttProject runs fine with Java 15 on my Ubuntu Linux. It is possible that something else is the issue, e.g. missing GTK3 libraries. But it is good to check first with the long-term-support Java Runtime which I use when developing.

Ok awesome news - it worked by using the zip file approach you linked to. Downloaded the ganttproject zip, set the export variable (had to do a search for liberica on my root to find out where it gets installed, no idea how to find out any other way) and ran the ganttproject from the zip folder, all from the command line. Open file dialogue works!

image

/home/domarius/.ganttproject.d/logs/.ganttproject-20210322125434.log

GanttProject 3.0.3004
Settings file:
	location: /home/domarius/.ganttproject
	size:4478
	is readable: true
java.class.path: :/home/domarius/Downloads/ganttproject-3.0.3000/eclipsito.jar
java.home: /usr/lib/jvm/liberica-jre-11-full
java.ext.dirs: null
java.io.tmpdir: /tmp
java.runtime.version: 11.0.10+9-LTS
java.vendor: BellSoft
java.vm.name: OpenJDK 64-Bit Server VM
java.vm.vendor: BellSoft
java.vm.version: 11.0.10+9-LTS
os.arch: amd64
os.name: Linux
os.version: 5.9.16-1-MANJARO
sun.java.command: com.bardsoftware.eclipsito.Launch --verbosity 1 --version-dirs /home/domarius/Downloads/ganttproject-3.0.3000/plugins:~/.ganttproject.d/updates --app net.sourceforge.ganttproject.GanttProject -log true -log_file /home/domarius/.ganttproject.d/logs/.ganttproject-20210322125434.log
user.country: AU
user.dir: /home/domarius/Downloads/ganttproject-3.0.3000
user.home: /home/domarius
user.language: en
user.timezone: Australia/Brisbane

InteropFactory: cannot load com.sun.javafx.embed.swing.newimpl.InteropFactoryN
Mar. 22, 2021 2:54:35 AM net.sourceforge.ganttproject.GPLogger log
INFO: Deleting old auto-save files
Mar. 22, 2021 2:54:35 AM biz.ganttproject.LoggerImpl debug
FINE: Creating main frame...
Mar. 22, 2021 2:54:35 AM biz.ganttproject.LoggerImpl debug
FINE: 1. loading look'n'feels
Mar. 22, 2021 2:54:36 AM biz.ganttproject.LoggerImpl debug
FINE: 2. loading options
Mar. 22, 2021 2:54:36 AM biz.ganttproject.LoggerImpl debug
FINE: 3. creating menus...
Mar. 22, 2021 2:54:36 AM biz.ganttproject.LoggerImpl debug
FINE: 4. creating views...
Mar. 22, 2021 2:54:36 AM biz.ganttproject.LoggerImpl debug
FINE: 5. calculating size and packing...
Mar. 22, 2021 2:54:36 AM biz.ganttproject.LoggerImpl debug
FINE: 6. changing language ...
Mar. 22, 2021 2:54:36 AM biz.ganttproject.LoggerImpl debug
FINE: 7. first attempt to restore bounds
Mar. 22, 2021 2:54:36 AM biz.ganttproject.LoggerImpl debug
FINE: 8. finalizing...

So what should we do from here? Is this something you can address from your end, or something I need to tweak on my end? Eg. set up a script file to run this local version of GanttProject.

I think it makes sense to contact the maintainer of a package in your Linux distro and ask them why their package doesn’t work while original ZIP + recommended Java Runtime do work.

I highly recommend using SDKMAN! for managing a zoo of tools. It can download and install Java Runtime from several vendors, with different versions and options (like with JavaFX or not) and switching between runtimes looks like sdk use java 11.0.9-librca

Thanks for the heads up about SDKMAN!, I’ve installed it, and done “sdk install java” as suggested by the instructions on the website. It automatically did “Setting java 11.0.10.hs-adpt as default.” without asking.

But running GanttProject (the one installed by the package manager) still uses the openjdk as shown in the log in my previous posts. So far the only way I can get GanttProject to work is with the local zip solution you suggested earlier. Happy to make a shortcut to this version instead, but I thought the purpose of SDKMAN! would be to force a different default than the one GanttProject is currently picking up?

I went to post a comment at the relevant AUR page AUR (en) - ganttproject but noticed the maintainer has already commented something relevant. So before I comment there, is there anything you want me to add in my comment regarding what he’s said below?

…what stops me from going to Java 15 or later is that the app as it currently stands needs to have $JAVA_HOME/lib passed in the module path, along with the JavaFX module names. But passing the aforementioned path in the module path and attempting to run results in a LayerInstantiationError, which I found that it’s caused due to passing $JAVA_HOME/lib in the first place. If you can help with this, I’m happy to do the necessary changes.

For the record, there is no JavaFX in AdoptOpenJDK Java Runtime. JavaFX is required.

Can you post the contents of /opt/ganttproject/ganttproject script?

Sorry for the delay.

Ok so that explains why the AdoptOpenJDK that comes with Manjaro is no good for GanttProject. I expect they have their reasons for using AdoptOpenJDK (things needing to be open etc.) but I can always ask a question on that AUR page for GanttProject if you like.

No problem!

#!/bin/bash
# Copyright 2014 BarD Software s.r.o
# This script launches GanttProject. It can be symlinked and can be ran from
# any working directory

SCRIPT_FILE="$0"

find_ganttproject_home() {
  WORKING_DIR="$(pwd)"
  # We want to find the directory where the real script file resides.
  # If real file is symlinked (possibly many times) then we need to follow
  # symlinks until we reach the real script
  # After that we run pwd to get directory path
  cd "$(dirname "$SCRIPT_FILE")"
  SCRIPT_FILE="$(basename "$SCRIPT_FILE")"

  while [ -L "$SCRIPT_FILE" ]; do
    SCRIPT_FILE="$(readlink "$SCRIPT_FILE")"
    cd "$(dirname "$SCRIPT_FILE")"
    SCRIPT_FILE="$(basename "$SCRIPT_FILE")"
  done

  pwd
}
GP_HOME="$(find_ganttproject_home)"
if [ -z "$GP_HOME" ]; then
  echo "GanttProject home directory is not set. Please point GP_HOME environment variable to the directory with GanttProject files."
  exit 1
fi

# Parse the command line arguments. In this script we parse only those arguments which
# are related to the Java VM launching. The remaining application-specific arguments
# are passed as-is to the Java process.
PARSED_ARGS=$(getopt -o d::j:: --long debug:: --long java-home:: -- "$@")
eval set -- "$PARSED_ARGS"

USE_BUNDLED_RUNTIME=1
DEBUG_ARGS=""
while true; do
  case "$1" in
    # Debug will switch on some debugging output and will allow for connecting to Java
    # process with a debugger
    -d|--debug)
      case "$2" in
        "")
          DEBUG_ARGS="-agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n"
          shift 2
          ;;
        *)
          DEBUG_ARGS="-agentlib:jdwp=transport=dt_socket,server=y,address=$2,suspend=n"
          shift 2
          ;;
      esac
      ;;
    # This allows for specifying the path to Java Runtime instead of the default bundled Java Runtime
    -j|--java-home)
      USE_BUNDLED_RUNTIME=0
      case "$2" in
        "")
          shift 2
          ;;
        *)
          JAVA_HOME="$2"
          shift 2
          ;;
       esac
       ;;
    --)
      shift
      break
      ;;
    *)
      echo "Unexpected argument $1"
      exit 1
      ;;
  esac
done

# Create log directory
GP_LOG_DIR="$HOME/.ganttproject.d/logs"
# Check if log dir is present (or create it)
if [ ! -d $GP_LOG_DIR ]; then
  if [ -e  $GP_LOG_DIR ]; then
    echo "File $GP_LOG_DIR exists and is not a directory. Please remove it and launch $SCRIPT_FILE again" >&2
    exit 1
  fi
  if ! mkdir -p $GP_LOG_DIR ; then
    echo "Could not create $GP_LOG_DIR directory. Is directory $HOME writable?" >&2
    exit 1
  fi
fi

# Create unique name for the application log file
LOG_FILE="$GP_LOG_DIR/.ganttproject-"$(date +%Y%m%d%H%M%S)".log"
if [ -e "$LOG_FILE" ] && [ ! -w "$LOG_FILE" ]; then
  echo "Log file $LOG_FILE is not writable" >2
  exit 1
fi

# If we can write to /tmp/ganttproject-launcher.log then LOG_TEXT
# will be empty, and we'll write the launcher logs to the file
# Otherwise it will be not empty and will accumulate the
# logged information in memory.
LOG_TEXT=""
echo "" > /tmp/ganttproject-launcher.log || LOG_TEXT="----"

log() {
  if [ ! -z "$LOG_TEXT" ]; then
    LOG_TEXT="$LOG_TEXT\n$1";
  else
    echo $1 >> /tmp/ganttproject-launcher.log
  fi
  [ -z "$DEBUG_ARGS" ] || echo $1
}

# This function checks if the passed argument is a good java command.
# It is expected to be executable and expected to return version 11+ when launched with -version
# argument.
check_java() {
  JAVA_COMMAND=$1
  log  "Searching for Java in $JAVA_COMMAND"

  if [ ! -x "$JAVA_COMMAND" ]; then
    log "...missing or not executable"
    JAVA_COMMAND=""
    return 1
  fi

  VERSION="$( $JAVA_COMMAND -version 2>&1 | head -n 1)"
  log "...found $VERSION"
  [[ "$VERSION" =~ "11." ]] && return 0;
  [[ "$VERSION" =~ "12." ]] && return 0;
  [[ "$VERSION" =~ "13." ]] && return 0;
  [[ "$VERSION" =~ "14." ]] && return 0;
  [[ "$VERSION" =~ "15." ]] && return 0;
  log "...this seems to be an old Java Runtime";
  JAVA_COMMAND=""
  return 1
}

# We search for Java Runtime in the following sequence:
# 1. Try using the bundled runtime in $GP_HOME, unless -j argument is passed
# 2. Try using JAVA_HOME value (this is also set by -j option)
# 3. Try using java command from the classpath
find_java() {
  if [ $USE_BUNDLED_RUNTIME == 1 ]; then
    check_java "$GP_HOME/runtime/bin/java" && return 0;
  fi
  if [ ! -z "$JAVA_HOME" ]; then
    check_java "$JAVA_HOME/bin/java" && return 0;
  fi
  JAVA_COMMAND=$(which java)
  if [ "0" = "$?" ]; then
    check_java "$JAVA_COMMAND" && return 0;
  fi
  if [ -d /usr/lib/jvm ]; then
    for d in /usr/lib/jvm/*; do
      check_java "$d/bin/java" && return 0;
    done;
  fi

  report_java_not_found && exit 1;
}

report_java_not_found() {
  log "JavaVM executable not found.
  You may want to set the path to the root of your Java Runtime installation
  in JAVA_HOME environment variable or pass it to ganttproject in --java-home argument";
  if [ -z "$LOG_TEXT" ]; then
    LOG_TEXT="$(cat /tmp/ganttproject-launcher.log)"
  fi

  LOG_TEXT=$(echo "$LOG_TEXT" | sed s/\"/\\\\\"/g)
  echo "$LOG_TEXT"
}

# Create updates directory if not exists
USER_UPDATES_DIR="$HOME/.ganttproject.d/updates"
mkdir -p "$USER_UPDATES_DIR"

find_java

log "JAVA_HOME=$JAVA_HOME"
log "JAVA_COMMAND=$JAVA_COMMAND"
log "GP_HOME=$GP_HOME"
log "user.dir=$(pwd)"

CLASSPATH="$CLASSPATH:$GP_HOME/eclipsito.jar"
export CLASSPATH
ECLIPSITO_ARGS="--verbosity 1 --version-dirs $GP_HOME/plugins:~/.ganttproject.d/updates --app net.sourceforge.ganttproject.GanttProject"
BOOT_CLASS=com.bardsoftware.eclipsito.Launch
JFX_ARGS="--module-path /usr/lib/jvm/java-11-openjfx/lib/ --add-modules=ALL-MODULE-PATH"

JAVA_ARGS="-Xmx1024m -Duser.dir=$(pwd) $DEBUG_ARGS $JFX_ARGS $BOOT_CLASS $ECLIPSITO_ARGS -log true -log_file $LOG_FILE"
if [ -n "$(echo \"$*\" | sed -n '/\(^\|\s\)-/{p;}')" ]; then
  "$JAVA_COMMAND" $JAVA_ARGS "$@"
else
  "$JAVA_COMMAND" $JAVA_ARGS "$@" &
fi

Hey man, what do you think? Is it worth me asking anything on the AUR page for my installation of GanttProject? Is there anything you want to add based on my previous post before I do?

I tried to install Manjaro in a virtual machine and build GanttProject, but gave up after it had spent a couple of hours “building”. Maybe my VM was not good enough. I will try again, but until that I can’t say anything.

Oh weird, I definitely had no such problems, with Manjaro KDE, very quick to install. Never used a VM though. I have it on my main PC and my media PC in my living room.

So it seems GanttProject should be using the version of Java set by SDKMAN, but for some reason, it isn’t.

For now I just keep running the stand alone version via a script that sets the environment variable every time.