Error when fx-jar native packaging using Inno Setup [fx: deploy] java.io.IOException

UPDATE:

I realized that the problem was with Inno installation. The installer is created, but Inno Setup automatically tries to start the installer, which requires administrator permissions. Because these permissions are not issued, the installer does not work.

If I give permission to any other installer prepared using Inno Setup, then my own package is created after a few minutes of granting permissions. But if I try after a long time, it will give an error again.

Original

I am trying to pack an exe from my JavaFX project in eclipse. I am using JDK 1.8.0_25 and Inno Setup 5 to create using build.xml Ant script.

My code reaches the fx:deploy , where I get this error when trying to create an exe file using Inno Setup. My Inno Setup is in the system path, and when I check the task manager, I see that Inno Setup is being used.

Here is the full stack trace I get:

 Using base JDK at: C:\Program Files\Java\jdk1.8.0_25\jre\..\jre [fx:deploy] java.io.IOException: Exec failed with code 2 command [[C:\Program Files (x86)\Inno Setup 5\iscc.exe, /oE:\Code\Java\ProjectHome\build\deploy\bundles, C:\Users\SHUBHA~1\AppData\Local\Temp\fxbundler7925821782057479088\images\win-exe.image\ProjectHome.iss] in C:\Users\SHUBHA~1\AppData\Local\Temp\fxbundler7925821782057479088\images\win-exe.image [fx:deploy] at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:165) [fx:deploy] at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:138) [fx:deploy] at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:132) [fx:deploy] at com.oracle.tools.packager.windows.WinExeBundler.buildEXE(WinExeBundler.java:533) [fx:deploy] at com.oracle.tools.packager.windows.WinExeBundler.bundle(WinExeBundler.java:349) [fx:deploy] at com.oracle.tools.packager.windows.WinExeBundler.execute(WinExeBundler.java:172) [fx:deploy] at com.sun.javafx.tools.packager.PackagerLib.generateNativeBundles(PackagerLib.java:511) [fx:deploy] at com.sun.javafx.tools.packager.PackagerLib.generateDeploymentPackages(PackagerLib.java:476) [fx:deploy] at com.sun.javafx.tools.ant.DeployFXTask.execute(DeployFXTask.java:265) [fx:deploy] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) [fx:deploy] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) [fx:deploy] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [fx:deploy] at java.lang.reflect.Method.invoke(Method.java:483) [fx:deploy] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [fx:deploy] at org.apache.tools.ant.Task.perform(Task.java:348) [fx:deploy] at org.apache.tools.ant.Target.execute(Target.java:435) [fx:deploy] at org.apache.tools.ant.Target.performTasks(Target.java:456) [fx:deploy] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393) [fx:deploy] at org.apache.tools.ant.Project.executeTarget(Project.java:1364) [fx:deploy] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) [fx:deploy] at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:36) [fx:deploy] at org.apache.tools.ant.Project.executeTargets(Project.java:1248) [fx:deploy] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:452) [fx:deploy] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:139) BUILD FAILED E:\Code\Java\ProjectHome\build\build.xml:173: Error: Bundler "EXE Installer" (exe) failed to produce a bundle. Total time: 2 minutes 45 seconds 

Can anyone help with this problem?

+5
source share
1 answer

This is not the case; you need to register the class path of the ant compiler. Do it:

  1. Open Netbeans and click the Tools link at the top or press Alt-t 2. Click options in the drop down menu from the tools or press Alt-o 3. Click Java on the top bar, it is the Java logo 4. Make sure you are on the ant tab, and your Ant-home has either, the built in Ant compiler(comes with netbeans, you do not need to set), or a custom one. On my computer, One virtual Machine says the Netbeans folder, and my Production Machine says, C:\Ant. Since I downloaded, and installed ant compiler myself for my production machine, more control! :D 5. Then make sure the Verbosity Level says Normal. 6. Then you will see a classpath box, it may be empty but should not be. 7. For mine, I have a few JDBC connectors for my database integration, and the ones you need to add, which are your project you are trying to make the installers for. So for my project it is a timeclock manager, and I named it TimeClock, but I also use another project as a library in that project, so I have 3 things total in my Classpath. 

You want to add any packages for this project that have the main method in them, so I have 2, since one of them is just a library, to the class path.

  8. My Classpath looks like this C:\Program Files (x86)\MySQL\MySQL Connector J\mysql-connector-java-5.1.34-bin.jar C:\Users\{my user Name}\Documents\NetBeansProjects\TimeClock\src\JFXPrint C:\Users\{my user Name}\Documents\NetBeansProjects\TimeClock\src\timeclock 9. Yours should look like this, if you only have one project 

C:\Users\{Your user Name}\Documents\NetBeansProjects\{Your Project name}\src\{Your package Name}

  9(mine). My Project name is TimeClock and My package names, where my main are located are, JFXPrint and timeclock. 10. YOUR DONE! Click Apply, Click OK, and restart the IDE. Then open it back up and right click the project and package as->All installers or whatever you want to do. 

Hope this helps, I ran into this problem when I had it and no one knows what to do. I finally found it when I added my badge. I realized that my class path is empty and fixed it for only one project, I don’t know if it works to set the path to the entire NetBeansProject folder, but I don’t think this is a good way for anything, Globals never ! Since I did not see the answers, I decided that many people have this problem, so I decided to post the answer when I found out how to fix it.

Good luck and happy programming!

+2
source

Source: https://habr.com/ru/post/1211635/


All Articles