簡體   English   中英

關於捆綁JRE的JSmooth問題

[英]JSmooth question on bundling a JRE

我正在嘗試將JRE與我的jar文件捆綁在一起,以便我可以在任何Windows計算機上運行我的應用程序,無論它是否具有Java。 jsmooth手冊說:

For the option to work correctly, you have to put a JRE in a directory near the EXE (generally in a subdirectory called "jre" or whatever). Once the exe is generated, it will FIRST try to locate the JRE at the location mentioned. If it can't be found there, then it will fallback in the normal jre look-up mode (search for a jre or a jdk in the Windows registry or in commonly-used environment variables). There is no JVM-version check when using a bundled JRE, as the packager is supposed to bundle a suitable JVM for the application.

這是否意味着jre子文件夾應該包含在jar中,是它自己獨立的jar,還是放在exe附帶的文件夾中? 如果它應該在exe文件夾中,我該如何指定jre子文件夾的相對路徑?

我的目錄如下:

建立/

-jre /

-myprogram.exe

我嘗試在GUI屏幕中使用..\\jre.\\jre..\\setup\\jre ,但它們都沒有奏效。

任何想法或線索將不勝感激。 非常感謝!

編輯:當我嘗試jre (和..\\jre我認為),當我嘗試運行它時,我從Windows獲得以下錯誤消息“MyProgram.exe已停止運行。” 當我查看問題詳細信息時,它說APPCRASH和故障模塊名稱是jvm.dll

只需將“jre”文件夾放在exe旁邊,然后在jsmooth的GUI中寫下“jre”(不帶引號)

作為替代方案,我建議使用成熟的開源項目NSIS。 您可以編寫一個安裝程序來下載並安裝JRE,然后創建快捷方式來運行您的程序。

以下是一些有用的鏈接:

您是否嘗試過Launch4J( http://launch4j.sourceforge.net/ ),我們剛剛從JSmooth切換到此,因為它更新,並且具有更多功能。

但是,將jre文件夾放在與.exe相同的文件夾中,然后使用jre \\作為它的路徑。 您需要確保.exe的工作文件夾是安裝文件夾。 並確保您在jre文件夾中有一個完整的JRE。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM