summaryrefslogtreecommitdiffstats
path: root/content/opt
diff options
context:
space:
mode:
Diffstat (limited to 'content/opt')
-rwxr-xr-xcontent/opt/davmail/davmail30
1 files changed, 30 insertions, 0 deletions
diff --git a/content/opt/davmail/davmail b/content/opt/davmail/davmail
new file mode 100755
index 0000000..051bbdd
--- /dev/null
+++ b/content/opt/davmail/davmail
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# Usage: davmail [</path/to/davmail.properties>]
+#
+# In case of SWT crash under JDK 9/11, uninstall SWT or remove SWT cases below
+#
+BASE=`dirname $0`
+# force GTK2 to avoid crash with OpenJDK 11
+JAVA_OPTS="-Dsun.net.inetaddr.ttl=60 -Djdk.gtk.version=2.2"
+#JAVA_OPTS="-Xmx512M -Dsun.net.inetaddr.ttl=60 -Djdk.gtk.version=2.2"
+JAVA=java
+# uncomment this to force JDK 8
+#JAVA=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
+# add JFX to classpath with OpenJDK 11
+JFX_CLASSPATH=/usr/share/java/javafx-base.jar:/usr/share/java/javafx-controls.jar:/usr/share/java/javafx-fxml.jar:/usr/share/java/javafx-graphics.jar:/usr/share/java/javafx-media.jar:/usr/share/java/javafx-swing.jar:/usr/share/java/javafx-web.jar
+if [ -e $BASE/davmail.jar ]; then
+ # this is the platform independent package
+ exec ${JAVA} $JAVA_OPTS -cp $BASE/davmail.jar:$BASE/lib/*:${JFX_CLASSPATH} davmail.DavGateway "$@"
+elif [ -e /usr/share/java/swt.jar ]; then
+ # SWT 3 is available
+ export LD_LIBRARY_PATH=/usr/lib/jni
+ exec ${JAVA} $JAVA_OPTS -cp /usr/share/davmail/davmail.jar:/usr/share/java/swt.jar:${JFX_CLASSPATH}:/usr/share/davmail/lib/* davmail.DavGateway "$@"
+elif [ -e /usr/share/java/swt4.jar ]; then
+ # SWT 4 is available, force GTK 2 in SWT
+ export LD_LIBRARY_PATH=/usr/lib/jni
+ export SWT_GTK3=0
+ exec ${JAVA} $JAVA_OPTS -cp /usr/share/davmail/davmail.jar:/usr/share/java/swt4.jar:${JFX_CLASSPATH}:/usr/share/davmail/lib/* davmail.DavGateway "$@"
+else
+ exec ${JAVA} $JAVA_OPTS -cp /usr/share/davmail/davmail.jar:/usr/share/davmail/lib/*:${JFX_CLASSPATH} davmail.DavGateway "$@"
+fi