diff --git a/src/java/davmail/ui/tray/DavGatewayTray.java b/src/java/davmail/ui/tray/DavGatewayTray.java index cff867b7..c138456e 100644 --- a/src/java/davmail/ui/tray/DavGatewayTray.java +++ b/src/java/davmail/ui/tray/DavGatewayTray.java @@ -225,16 +225,18 @@ public final class DavGatewayTray { */ public static void init() { if (!Settings.getBooleanProperty("davmail.server")) { - // first try to load SWT before with Java - ClassLoader classloader = DavGatewayTray.class.getClassLoader(); - try { - // trigger ClassNotFoundException - classloader.loadClass("org.eclipse.swt.SWT"); - // SWT available, create tray - davGatewayTray = new SwtGatewayTray(); - davGatewayTray.init(); - } catch (ClassNotFoundException e) { - DavGatewayTray.info(new BundleMessage("LOG_SWT_NOT_AVAILABLE")); + // first try to load SWT before with Java, except on 1.7 + if (System.getProperty("java.version").compareTo("1.7") < 0) { + ClassLoader classloader = DavGatewayTray.class.getClassLoader(); + try { + // trigger ClassNotFoundException + classloader.loadClass("org.eclipse.swt.SWT"); + // SWT available, create tray + davGatewayTray = new SwtGatewayTray(); + davGatewayTray.init(); + } catch (ClassNotFoundException e) { + DavGatewayTray.info(new BundleMessage("LOG_SWT_NOT_AVAILABLE")); + } } // try java6 tray support if (davGatewayTray == null) { diff --git a/src/java/davmail/ui/tray/OSXAwtGatewayTray.java b/src/java/davmail/ui/tray/OSXAwtGatewayTray.java index 9eff9c09..3c0d3e17 100644 --- a/src/java/davmail/ui/tray/OSXAwtGatewayTray.java +++ b/src/java/davmail/ui/tray/OSXAwtGatewayTray.java @@ -35,6 +35,7 @@ import java.awt.image.RenderedImage; /** * Extended Awt tray with OSX extensions. */ +@SuppressWarnings("Since15") public class OSXAwtGatewayTray extends AwtGatewayTray { protected static final String OSX_TRAY_ACTIVE_PNG = "osxtray2.png"; protected static final String OSX_TRAY_PNG = "osxtray.png";