I installed fiji (a distribution of imagej) on my Ubuntu 16.04 machine, and double-clicking the desktop icon opened the app for a second, or rather it tried to open, and then died. I looked for an answer online, and found on this page http://imagej.1557.x6.nabble.com/Fiji-crashes-UI-on-Ubuntu-all-recent-versions-td5005603.html that one can try
./ImageJ-linux64 --dry-run
This prints out the run command used by the program. It calls the system java. So I copied out the command, and switched to use the included java (fiji and imagej come with their own java) and that fixed it. I have created a shell script with the command (referencing the included java executable), and this script works to start fiji.
Go to your fiji installation folder (Fiji.app or whatever it is called) and run
./ImageJ-linux64 --dry-run
This will output a long string, something like
java -Dpython.cachedir.skip=true -Dplugins.dir=/home/pwarner/Schreibtisch/Bildanalyse/Fiji.app -Xmx3714m -Xincgc -XX:PermSize=128m -Djava.class.path=/home/pwarner/Schreibtisch/Bildanalyse/Fiji.app/jars/imagej-launcher-4.0.5.jar -Dimagej.dir=/home/pwarner/Schreibtisch/Bildanalyse/Fiji.app -Dij.dir=/home/pwarner/Schreibtisch/Bildanalyse/Fiji.app -Dfiji.dir=/home/pwarner/Schreibtisch/Bildanalyse/Fiji.app -Dfiji.defaultLibPath=lib/amd64/server/libjvm.so -Dfiji.executable=./ImageJ-linux64 -Dij.executable=./ImageJ-linux64 -Djava.library.path=/home/pwarner/Schreibtisch/Bildanalyse/Fiji.app/lib/linux64:/home/pwarner/Schreibtisch/Bildanalyse/Fiji.app/mm/linux64 net.imagej.launcher.ClassLauncher -ijjarpath jars -ijjarpath plugins net.imagej.Main
Copy the command into a script file and substitute for the first 'java' the full path to the included java executable, something like
/home/pwarner/Schreibtisch/Bildanalyse/Fiji.app/java/linux-amd64/jdk1.8.0_66/jre/bin/java
Save the file in the directory (or wherever you like) and call it to start fiji, something like
./start_fiji.sh