本文介绍了JAR安装程序,可自动检测Java是否存在并自动启动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我需要构建一个执行以下操作的安装程序:I need to build an installer that does the following: 在客户端上安装我的jar。 自动检测是否安装了JRE(在这种情况下不会重新安装),否则安装它时无需用户点击其他按钮。 自动启动客户端启动时的应用程序。 适用于Windows,Mac和Linux。Installs my jar on the client.Auto-detects if JRE is installed (in which case it does not re-install it), otherwise installs it without the user clicking on another button.Auto-starts the application when the client is booted.Works across Windows, Mac and Linux.任何想法如何去做?推荐答案如果商业工具还可以,我可以推荐 install4j 。 1,2和4很容易用它做,但大约3我不确定。 编辑:您可以通过将您的应用程序安装为服务来实现这一点,install4j支持所有平台。引用其功能页面:If a commercial tool is ok, I can recommend install4j. 1, 2 and 4 are easy to do with it, but about 3 I'm not sure. Edit: You could probably achieve that by installing your app as a "service", which install4j supports for all platforms. Quoting from its Features page: 编辑:关于#2,JRE检测:install4具有非常好的,灵活的JRE捆绑/检测选项。您可以包含JRE(静态或动态,共享或不共享)或者更喜欢使用已存在的JRE,并可以从安装程序中下载JRE作为后备。请查看以下文档:安装程序如何查找JRE 和 JRE Bundles 。Edit: Regarding #2, JRE detection: install4 has pretty nice, flexible options for JRE bundling/detecting. You can include a JRE (statically or dynamically, shared or not) or prefer to use one already present, with the possibility to download a JRE from within your installer as a fallback. Check these docs for more: How Installers Find a JRE and JRE Bundles.(更多关于我使用install4j的经验。)对于其他工具,你可以查看一些早期的Java安装程序问题:For other tools, you could check some of the earlier Java installer questions on SO: 分发Java应用程序的最佳方式是什么? Java应用程序安装程序 什么是最好的java安装工具?What’s the best way to distribute Java applications?Java Application InstallersWhat is the best installation tool for java? 这篇关于JAR安装程序,可自动检测Java是否存在并自动启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-03 11:43