0

我正在尝试创建一个 iReport 的可执行文件 (.exe),其中包含我的模块。当我运行目标 create-iReport-distro-win-installer 时,我收到以下错误。注意:我使用的是 netbeans 6.5.1

java.io.IOException: Cannot run program "makensis" (in directory "C:\Program Files\NetBeans 6.5.1\iReport-3.7.2-src"): CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
        at java.lang.Runtime.exec(Runtime.java:593)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:832)
        at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:447)
        at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:461)
        at net.sf.nsisant.Task.execute(Task.java:205)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
        at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:273)
        at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:499)
        at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
        at java.lang.ProcessImpl.start(ProcessImpl.java:30)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
        ... 24 more
C:\Program Files\NetBeans 6.5.1\iReport-3.7.2-src\build.xml:327: Command failed: 'makensis /DPRODUCT_VERSION=3.7.2 /DPRODUCT_NAME=iReport /DPRODUCT_WEB_SITE=http://ireport.sourceforge.net "C:\Program Files\NetBeans 6.5.1\iReport-3.7.2-src\etc\iReportInstaller.nsi"'
BUILD FAILED (total time: 1 minute 22 seconds)
4

1 回答 1

2

您必须指定 nsis 可执行文件的完整路径,例如 C:\Programme\NSIS\makensis.exe

或者您可以将路径添加到 PATH 环境变量:系统设置 -> 系统 -> 高级 -> 环境变量。不要忘记重新启动 Netbeans 以识别对此变量的更改。

于 2010-06-02T06:01:54.767 回答