2010-06-02 39 views
0

我正在嘗試使用包含在其中的模塊創建iReport的可執行文件(.exe)。當我運行目標create-iReport-distro-win-installer時,出現以下錯誤。 注:我使用NetBeans 6.5.1在i中創建win安裝程序的問題

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) 

回答

2

必須指定完整路徑NSIS可執行文件,如C:\程序\ NSIS \ makensis.exe

或者,您可以添加路徑PATH環境變量:系統設置 - >系統 - >高級 - >環境變量。不要忘記重新啓動Netbeans以識別對此變量的更改。

+0

嗨, 感謝您的回覆 有一個名爲nsisant1.1.jar的jar提供了iReport設計器。 我不知道makensis 我需要下載makensis.exe嗎? – Jagadesh 2010-06-02 06:15:46

+0

我不知道,但我承認這一點。我不能相信它與Netbeans一起。在http://nsis.sourceforge.net/下載它下載 – Daniel 2010-06-02 11:29:43

+0

感謝丹尼爾..它的工作 – Jagadesh 2010-06-04 09:12:30