使用launch4j和jdk8包装.exe需要很长时间才能启动。使用jdk7开始几乎是即时的 [英] Wrapped .exe with launch4j and jdk8 takes very long to start. Using jdk7 instead starts almost instant

查看:183
本文介绍了使用launch4j和jdk8包装.exe需要很长时间才能启动。使用jdk7开始几乎是即时的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下问题:

我曾经有一个launch4j配置使用bundeled jdk / jre7在我的可运行jar中创建一个包装的可执行文件已有一段时间了。

I used to have a launch4j config to create a wrapped executable from my runable jar using a bundeled jdk/jre7 for quite some time.

程序(使用该.exe启动)几乎立即开始使用jdk7。
我现在不得不切换到jdk8,导致启动非常缓慢。一切正常,这不是问题,但是.exe的启动过程需要大约1-2分钟,我根本就不明白为什么。

The Programm (launched with that .exe) starts almost immediatly with jdk7. I now had to switch to jdk8 which results in a VERY slow startup. Everything works just fine, that is not the problem, but the launch process of that .exe takes ~1-2 Minutes and I simply don't get why.

开始eclipse中的应用程序(使用相同的JDK8)它会在几秒钟内启动(因为它应该!)。

Starting the application from within eclipse (using the same JDK8) it starts within seconds again (as it should!).

所以...任何想法可能导致这个以及如何我能解决吗?

So... Any ideas what might cause this and how I can fix it?

这是我目前的l4j.xml:

Here is my current l4j.xml:

<?xml version="1.0" encoding="UTF-8"?>
<launch4jConfig>
  <dontWrapJar>false</dontWrapJar>
  <headerType>gui</headerType>
  <jar>C:\Users\user\workspace\DataUpdater\release\bin\DataUpdater-v2.6.1.jar</jar>
  <outfile>C:\Users\user\workspace\DataUpdater\release\DataUpdater.exe</outfile>
  <errTitle>DataUpdater: Kein kompatibles JRE gefunden</errTitle>
  <cmdLine></cmdLine>
  <chdir>.</chdir>
  <priority>high</priority>
  <downloadUrl>http://java.com/download</downloadUrl>
  <supportUrl>https://www.google.de/</supportUrl>
  <stayAlive>true</stayAlive>
  <restartOnCrash>false</restartOnCrash>
  <manifest></manifest>
  <icon>C:\Users\user\workspace\DataUpdater\res\icons\DataUpdater.ico</icon>
  <singleInstance>
    <mutexName>DataUpdater v2.6.1</mutexName>
    <windowTitle>DataUpdater v2.6.1</windowTitle>
  </singleInstance>
  <jre>
    <path>./bundeled/jre1.8.0_92</path>
    <bundledJre64Bit>true</bundledJre64Bit>
    <bundledJreAsFallback>false</bundledJreAsFallback>
    <minVersion>1.8.0</minVersion>
    <maxVersion>1.8.0_92</maxVersion>
    <jdkPreference>jdkOnly</jdkPreference>
    <runtimeBits>64</runtimeBits>
    <initialHeapPercent>33</initialHeapPercent>
    <maxHeapPercent>80</maxHeapPercent>
    <opt>-Dfile.encoding=UTF-8</opt>
  </jre>
  <versionInfo>
    <fileVersion>2.6.1.0</fileVersion>
    <txtFileVersion>v2.6.1</txtFileVersion>
    <fileDescription>DataUpdater: Anwendung zum aktualisieren von -Datensätzen mittels externer Datenquellen wie Excel-Tabellen direkt auf Datenbankebene.</fileDescription>
    <copyright>Max Mustermann</copyright>
    <productVersion>2.6.1.0</productVersion>
    <txtProductVersion>v2.6.1</txtProductVersion>
    <productName>DataUpdater</productName>
    <companyName>Max Mustermann</companyName>
    <internalName>DataUpdater v2.6.1</internalName>
    <originalFilename>DataUpdater.exe</originalFilename>
  </versionInfo>
  <messages>
    <startupErr>DataUpdater konnte nicht gestartet werden. </startupErr>
    <bundledJreErr>DataUpdater erwartet ein bundled JRE. Dieses wurde nicht gefunden oder ist beschädigt.</bundledJreErr>
    <jreVersionErr>DataUpdater benötigt eine Java Laufzeitumgebung. Diese konnte nicht gefunden werden.
Bitte stellen Sie sicher, dass Java 8 auf Ihrem System installiert ist.</jreVersionErr>
    <launcherErr>Die Windows Registry verweist auf eine nicht mehr vorhandene oder beschädigte Java Installation.</launcherErr>
    <instanceAlreadyExistsMsg>DataUpdater wird bereits ausgeführt. 
Es ist immer nur eine DataUpdater-Instanz gleichzeitig erlaubt.</instanceAlreadyExistsMsg>
  </messages>
</launch4jConfig>

编辑:
可执行文件在许多不同的机器上作出相同的反应,因此它与我的本地环境......

The executable reacts the same on many different machines so it is not related to my local environment...

其他信息:
我刚注意到,直接从jar启动应用程序而不是可执行文件导致同样的慢启动。
所以这必须以某种方式与jdk8相关而不是与l4j相关。
我不明白为什么它使用相同的jdk8从eclipse中开始这么快。

Additional Info: I just noticed, that launching the application from the jar directly instead of the executable results in the same slow startup. So this MUST be related to the jdk8 somehow and not to l4j. What I do not understand is why it starts so fast from within eclipse using the same jdk8.

推荐答案

我发现没有任何好结果的长期研究,这种挂断与launch4j& Java 8但与log4j和Java 8有关。

After a long research without any good result i noticed, that this "hang up" is not related to launch4j & Java 8 but related to log4j and Java 8.

仍然不清楚是什么令人兴奋地引起了这个问题,但这是另一个问题的主题。

Still not clear what excatly causes this but it is the topic of another question.

这篇关于使用launch4j和jdk8包装.exe需要很长时间才能启动。使用jdk7开始几乎是即时的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆