maven项目使用JavaFX生成可运行exe文件

原文:https://blog.csdn.net/qq_27503061/article/details/90612455

最近研究OCR技术,需要使用javafx-maven-plugin生成可运行的exe文件,但是遇到以下问题:

[INFO] Skipping 'EXE 安装程序' because of configuration error '找不到 InnoSetup 编译器 (iscc.exe)。'
Advice to fix:   从 http://www.jrsoftware.org 下载 InnoSetup 5 或更高版本, 然后将其添加到 PATH。
[INFO] Skipping 'MSI 安装程序' because of configuration error '找不到 WiX 工具 (light.exe, candle.exe)。'
Advice to fix:   从 http://wix.sf.net 下载 WiX 3.0 或更高版本, 然后将其添加到 PATH。
[INFO] Skipping 'WebStart JNLP Bundler' because of configuration error 'No OutFile Specificed'
Advice to fix: Please specify the name of the JNLP Outut file in 'jnlp.outfile'

eclipse控制台错误信息
通过查阅大量资料,把它解决了,特记录下来,给需要的人(包括我自己)。

首先安装Inno Setup

通过Inno Setup官网下载、安装对应版本,需要说明两点:

  1. 版本:虽然控制台提示5或更高版本均可以,但是我最开始安装的是6,最终还是失败了;最后,我改回5就可以了。
  2. 路径:和1有关,最开始我安装6时,我是将目录放在D盘的, 失败后,卸载重装,路径则是选择的是默认路径。

安装成功后,配置环境变量,Start --> Computer -->System Properties --> Advanced System Properties --> Environment Variables then choose System Variables, Path, and then Edit. Enter the following to add Inno Setup 5 to the Path: C:Program Files (x86)Inno Setup 5;, 如下图所示:
环境变量配置
配置完成后,打开cmd,输入iscc.exe,出现下图,则表示安装成功:
Inno Setup安装

安装WiX Toolset

通过WiX Toolset官网,下载安装对应版本(我下载的是3.10)。

配置环境变量,Start --> Computer -->System Properties --> Advanced System Properties --> Environment Variables then choose System Variables, Path, and then Edit. Enter the following to add Inno Setup 5 to the Path: C:Program Files (x86)WiX Toolset v3.10in;, 如下图所示:
WiX Toolset安装步骤
配置完成后,打开cmd,分别输入light.exe ,candle.exe,出现下图,则表示安装成功:
输入light.exe:
light.exe
输入candle.exe时:
在这里插入图片描述

至此,需要的配置文件基本都已经安装完毕,此时再打包时可以看见这两个错误已经不存在了,如下图所示(还有一个问题,待解决ing,请勿略它!):

成功

原文地址:https://www.cnblogs.com/shihaiming/p/13444396.html