From 94a59be635ad7592e3a31f0724ade9345c47c834 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Tue, 1 Aug 2017 11:43:27 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-3406=20win10=E5=86=85=E5=AD=98=E4=B8=8D?= =?UTF-8?q?=E8=B6=B3=E6=97=B6=E6=89=BE=E4=B8=8D=E5=88=B0=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/start/StartServer.java | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/designer_base/src/com/fr/start/StartServer.java b/designer_base/src/com/fr/start/StartServer.java index e21beef7b1..7c5b77f524 100644 --- a/designer_base/src/com/fr/start/StartServer.java +++ b/designer_base/src/com/fr/start/StartServer.java @@ -14,10 +14,7 @@ import com.fr.env.SignIn; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.general.Inter; -import com.fr.stable.EnvChangedListener; -import com.fr.stable.ProductConstants; -import com.fr.stable.StableUtils; -import com.fr.stable.StringUtils; +import com.fr.stable.*; import com.fr.stable.project.ProjectConstants; import com.fr.start.server.JettyHost; @@ -154,8 +151,7 @@ public class StartServer { Desktop.getDesktop().browse(new URI(uri)); } catch (IOException e) { - JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer_Set_default_browser")); - FRContext.getLogger().errorWithServerLevel(e.getMessage(), e); + startBrowserFromCommand(uri, e); } catch (URISyntaxException e) { FRContext.getLogger().errorWithServerLevel(e.getMessage(), e); } catch (Exception e) { @@ -164,6 +160,20 @@ public class StartServer { } } + private static void startBrowserFromCommand(String uri, IOException e) { + if (OperatingSystem.isWindows()) { + try { + // win10 内存用到到80%左右的时候, Desktop.browser经常提示"存储空间不足, 无法处理改命令", 用rundll32可以打开. + Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + uri); + } catch (IOException ee) { + JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer_Set_default_browser")); + FRContext.getLogger().errorWithServerLevel(e.getMessage(), e); + } + } else { + FRContext.getLogger().errorWithServerLevel(e.getMessage(), e); + } + } + private static class InformationPane extends BasicPane { private static final long serialVersionUID = 1L;