I just installed fop, which is a Java binary, with apt. When I launch fop, I get next warning:

[warning] /usr/bin/fop: JVM flavor 'sun' not understood

I wonder if it possible to fix the cause of the warning and get rid of it.

Here is the output of apt-cache policy fop:

  Installed: 1:2.1-7
  Candidate: 1:2.1-7
  Version table:
 *** 1:2.1-7 500
        500 http://fr.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://fr.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
        100 /var/lib/dpkg/status

That of java -version:

openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment (build 11.0.5+10-post-Ubuntu-0ubuntu1.118.04)
OpenJDK 64-Bit Server VM (build 11.0.5+10-post-Ubuntu-0ubuntu1.118.04, mixed mode, sharing)

And finally update-java-alternatives -l:

java-1.11.0-openjdk-amd64      1111       /usr/lib/jvm/java-1.11.0-openjdk-amd64
java-1.8.0-openjdk-amd64       1081       /usr/lib/jvm/java-1.8.0-openjdk-amd64
java-1.9.0-openjdk-amd64       1091       /usr/lib/jvm/java-1.9.0-openjdk-amd64
  • How did you installed fop? Please add output of apt-cache policy fop, java -version, update-java-alternatives -l to the question.
    – N0rbert
    Jan 22, 2020 at 17:55
  • I issued sudo apt install fop. I will add the output of the commands editing my question. Jan 22, 2020 at 20:02

1 Answer 1


The warning is emitted by the /usr/lib/java-wrappers/java-wrappers.sh script, because sun is not mentioned in /usr/lib/java-wrappers/jvm-list.sh.

What you can do to avoid the warning is set up the java environment variables yourself. You can find out which values the java wrappers would supply by starting a fresh shell; running the java wrapper commands manually and look at the results, like this:

. /usr/lib/java-wrappers/java-wrappers.sh
find_java_runtime openjdk sun
echo $JAVA_CMD

Then, before running your fop command, export these variables in your environment. Example for my system:

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export JAVA_CMD=/usr/lib/jvm/java-11-openjdk-amd64/bin/java

Note that doing this by hand will override any java version you may have chosen with the alternatives system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.