简体   繁体   English

如何在Launch4j中使用Bundle JRE选项

[英]How do I use the Bundle JRE option in Launch4j

I have worked with Java for a while now, long enough to start producing my own programs with GUIs and not just little sample programs from a text book that run in Eclipse. 我已经使用Java一段时间了,足够长的时间来开始用GUI创建我自己的程序,而不仅仅是在Eclipse中运行的教科书中的一些示例程序。 I wanted to make my programs more user friendly for the user, specifically the Windows users, by wrapping the executable Jar into an Exe. 我希望通过将可执行文件Jar包装到Exe中,使我的程序对用户,特别是Windows用户更加友好。 So I found Launch4j, it seems to do a pretty good job but I have no idea what over half of the options in that program mean (It took me an hour to figure out how to get it to make a functional Exe). 所以我找到了Launch4j,它似乎做得非常好,但我不知道该程序中超过一半的选项意味着什么(我花了一个小时来弄清楚如何让它来制作一个功能性的Exe)。 I handed that to a fried to test and he returned to me saying that he was getting the no JRE found error. 我把它递给了一个油炸试验,他回到我身边说他没有发现JRE错误。 Well I wondered how I can force the end users to have the JRE then I noticed the bundle JRE option in Launch4j. 好吧,我想知道如何强制最终用户拥有JRE然后我注意到Launch4j中的捆绑JRE选项。 But how do I use it? 但是我该如何使用它? Do I download the JRE offline installer for Windows and it will run that if it can't find an installed one? 我是否下载了Windows的JRE脱机安装程序,如果找不到已安装的安装程序,它将运行吗? Then what about proper version for the system (32-bit v 64-bit). 那么系统的正确版本(32位v 64位)怎么样? I guess I was thinking I would lead it to this mysterious package containing a JRE and my wrapped program would use that to run. 我想我以为我会把它带到这个包含JRE的神秘软件包中,我的包装程序会用它来运行。 Just can someone please tell me how to use that function, what if anything I have to download, etc. 只是有人可以请告诉我如何使用该功能,如果我需要下载什么,等等。

If Launch4j isn't the best program to do this then please recommend something else, I have only just started to get into this, for all I know there is a better wrapper out there. 如果Launch4j不是最好的程序,那么请推荐别的东西,我刚刚开始进入这个,因为我知道有更好的包装。

Your "installation" will need an already installed JRE (with jre/bin folder with java.exe and all the other files) for a "bundled" JRE. 您的“安装”将需要已安装的JRE(带有java.exe和所有其他文件的jre/bin文件夹)用于“捆绑”JRE。 You can't pack an Java installer with launch4j. 您无法使用launch4j打包Java安装程序。

Doesn't it show to your friend the option to download and install Java if it doesn't find a JRE? 如果没有找到JRE,它是否向您的朋友显示下载和安装Java的选项?

If you want to install Java alongside with your application, take a look at NSIS . 如果您想在应用程序旁边安装Java,请查看NSIS

There's another one: IzPack . 还有一个: IzPack It creates multi-plataform installer. 它创建了多平台安装程序。 But, as it depends on Java, it's the same case of launch4j -> you'll need to download and install Java first. 但是,由于它依赖于Java,它与launch4j的情况相同 - >您需要首先下载并安装Java。 (I didn't use IzPack yet, but when I was looking for a solution, it was one of my alternatives.) (我还没有使用过IzPack,但是当我在寻找解决方案时,它是我的替代方案之一。)

I have created my own version of the launch4j that allows downloading and installing of required JRE automatically. 我创建了自己的launch4j版本,允许自动下载和安装所需的JRE。 If you want to give it a try, get it here: https://github.com/maztan/launch4j_auto_jre_download . 如果您想尝试一下,请在此处获取: https//github.com/maztan/launch4j_auto_jre_download After running the launch4j, set the options in the "JRE" tab. 运行launch4j后,在“JRE”选项卡中设置选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM