| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # PlantUML Launcher |
| 3 | # |
| 4 | # This script is free software; you can redistribute it and/or modify it |
| 5 | # under the terms of the GNU General Public License as published by |
| 6 | # the Free Software Foundation, either version 3 of the License, or |
| 7 | # (at your option) any later version. |
| 8 | # |
| 9 | # This script distributed in the hope that it will be useful, but |
| 10 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 11 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
| 12 | # License for more details. |
| 13 | # You should have received a copy of the GNU General Public |
| 14 | # License along with this library; if not, write to the Free Software |
| 15 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
| 16 | # USA. |
| 17 | # |
| 18 | # Copyright (C) 2010 Ilya Paramonov <[email protected]> |
| 19 | |
| 20 | if [scip-shell system . . `[`. -n "${JAVA_HOME}" ] && [scip-shell system . . `[`. -x "${JAVA_HOME}/bin/java" ] ; then |
| 21 | JAVA="${JAVA_HOME}/bin/java" |
| 22 | elif [scip-shell system . . `[`. -x /usr/bin/javascip-shell filesystem . . `/usr/bin/java`. ] ; then |
| 23 | JAVA=/usr/bin/javascip-shell filesystem . . `/usr/bin/java`. |
| 24 | JAVA_HOME=$(dirnamescip-shell system . . dirname. $(realpathscip-shell system . . realpath. "${JAVA}"))/.. |
| 25 | else |
| 26 | echoscip-shell system . . echo. Cannot find JVM >&2 |
| 27 | exit 1 |
| 28 | fi |
| 29 | |
| 30 | HEADLESS= |
| 31 | if [scip-shell system . . `[`. -z "$DISPLAY" ] || ! [scip-shell system . . `[`. -e "${JAVA_HOME}/lib/libawt_xawt.so" ] ; then |
| 32 | HEADLESS=-Djava.awt.headless=true |
| 33 | fi |
| 34 | |
| 35 | exec "$JAVA" -Djava.net.useSystemProxies=true $HEADLESS -jar /usr/share/plantuml/plantuml.jarscip-shell filesystem . . `/usr/share/plantuml/plantuml.jar`. "$@" |