0

i noticed that i can not deploy a JavaFX application with javapackager two times without closing the IDE / commandline. I want to create a native image of my application on a Windows 10 machine.

After the second deploy I get Exception: java.io.IOException: Access denied. After closing and reopen it works for one deploy again.

I can reproduce this Issue with Netbeans (create a JavaFX Application, enable Native Packaging, and then package as "image only") on 3 different PCs with Oracle JDK 8u121 and Windows 10. I also get this error in a gradle project in eclipse trying to deploy it with the official ant task (https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/javafx_ant_tasks.html)

Also tried it on an Ubuntu VM and OpenJDK. There is no problem.

Can somebody of you reproduce this error on Windows 10, too? Is there a workaround or offical bug report for this?

Thanks in advance Joey

Joey
  • 37
  • 4

1 Answers1

1

This is a known problem, the cause is a file-handle leak and already got reported by me: https://bugs.openjdk.java.net/browse/JDK-8148717 It is only windows-specific, as the file-locking on the JRE-folder works on windows-systems, other OS don't lock.

This bug got worked around inside the JavaFX-Gradle-Plugin, as gradle starts daemons, which hold up the JVM, the JavaFX-Maven-Plugin didn't need it, because the JVM is always closed.

Disclaimer: I'm the creator of the JavaFX-Gradle-Plugin and maintainer of the JavaFX-Maven-Plugin.

FibreFoX
  • 2,858
  • 1
  • 19
  • 41
  • Thanks for the bug. I've increased the priority. – Chris Bensen Mar 22 '17 at 16:41
  • @ChrisBensen thanks for this :) I had to nasty monkeypatch the class within the javafx-gradle-plugin, but couldn't provide a nice reproducer – FibreFoX Mar 22 '17 at 16:49
  • I was just looking at it and it reminded me of another bug. I marked it as duplicate since it has already been fixed in JDK 9. I'm not sure if it'll get backported to JDK 8 or not. – Chris Bensen Mar 22 '17 at 16:58