0

I have a weird problem - I have a javafx program that I compile and package using maven (for windows I use Inno setup to create a setup package). After upgrading from Java 8 to Java 10 (updating the plugins in the pom.xml file and updating the configuration) - iv'e gotten to a point where the build completes successfully.

The problem is that after installing the package on windows - the exe file that's starts the program won't run properly. It starts for a split second and then stops.

The weird part : if I try to run the same exe from the target\bundle folder (the folder where maven prepares the files for the packager) - it runs fine!

the two folders - target\bundle and Programs files(x86)/vendor/appname are identical (files and the configuration file content).

I checked the permissions of the exe under Programs files(x86)/vendor/appname and they seem fine.

I'm testing on a windows 8.1 machine (an on others which display the same behavior, which leads me to believe this a real problem and not a mis configuration of my testing machine).

the same script is used for creating an installation package for MAC OSX and everything works fine on OSX so it's not a problem with the code.

Any ideas as to what's causing this and how to fix it?

Additional info :

  1. This has only started to happen since moving to Java 10. Java 8 and 9 work perfectly.

  2. My app does not write to any files in the program files installation folder. configuration and log files are written to in the %user%/AppData folder only.

FunkSoulBrother
  • 2,057
  • 18
  • 27
  • Is JavaFX in Java 10 even still available in the standart JDK/JRE? Because it is about to get removed. – Impulse The Fox Apr 26 '18 at 10:16
  • I there was the issue - I would expect the maven build to fail/the execution of the app from the target/bundle folder to fail but they don't. Any way - maven copies all dependencies to the app folder so there shouldn't be a problem. – FunkSoulBrother Apr 26 '18 at 10:19
  • So if you manually copy the application with all its dependencies to `Program Files` does it work or not? – Martin Prikryl Apr 26 '18 at 13:03
  • When I copy the application folder (as is) from target/bundle into a program files folder - it works. tried in both "Program files" and "Program Files (x86). – FunkSoulBrother Apr 26 '18 at 18:00
  • So there must be some difference between the files that are installed by Inno Setup and the files that you copy manually. Did you check? (I'm not notified about your response, if you do not use `@MartinPrikryl`) – Martin Prikryl Apr 27 '18 at 10:21
  • Thanks @MartinPrikryl, I ran a folder compare and the files seem to be identical . The only difference I could spot is in the permissions. Files installed by Inno setup have stricter permissions than what I see in the target/bundle folder but still - they should be sufficient for running the app (the group "Authenticated Users" has permissions to execute the app exe file). I'll run a setup created by the Java 9 version of the app (which worked fine) and then examine the differences between them and the files in the Java 10 installation. I'll report here after I do that. – FunkSoulBrother Apr 27 '18 at 13:09
  • Can you post that as an answer? And edit your question to include the information that could be used to find that answer in the first place? This way your question can be found by people having the same problem. – Martin Prikryl Apr 29 '18 at 08:48

1 Answers1

1

I found the problem by creating a working setup package manually with the Inno setup wizard and then comparing it to the one I had that was not.

After doing this I compared the iss file (Inno config file) that the wizard created with the only that wasn't working. It turned out that the bouncy castle jar files created a problem. The iss script from the previous version copied them to the lib/ext folder and that created a duplicate classpath problem for the java class resolver as there were two copies of the jar.

This is not needed in Java 9 and Java 10. Removing the manual addition of the bouncy castle jars from the iss file fixed the problem.

Hope this helps someone in the future :)

FunkSoulBrother
  • 2,057
  • 18
  • 27