Unable to make JavaFX jar (access denied error)
Hi so I'm trying to make an independent JavaFX jar file. So I set the type to JavaFX jar, I set the application class as needed & cave it a title in project structure settings. But whenever I run it it gives me an access denied error on the directory where the jar should be made. This doesn't make any sense since I have access to it obviously & can delete it so I'm not really sure what's going on.
I see that other's have had the same issue but with no satisfactory solution (especially since this has apparently been happening to people for years):
* https://stackoverflow.com/questions/32749608/intellij-idea-javafx-packager-access-denied (for this one no one really gave a concrete error they all just said they deleted it & it magically started working but as I said I've already tried that...)
* https://intellij-support.jetbrains.com/hc/en-us/community/posts/206155489-JavaFX-Packager-Error (in this one the person had some sort of Unicode characters in their path but I don't so it doesn't help)
* https://intellij-support.jetbrains.com/hc/en-us/community/posts/206841945-JavaFX-packaging-fails (this one is pretty old & probably not relevant)
What should I do? I want a standalone jar that I can just click to run my app... rn I have to run it from IntelliJ every time. P.S. I'm using Java & Java FX 11
Please sign in to leave a comment.
Hello,
Am I got you right that you have access denied error when you run JAR file from OS? Don't you use any antivirus software that might cause the issue?
No it was when I tried to build it. I deleted the jar from the project settings and started from scratch though. Now it gives me the error: Error:Java FX Packager: Can't build artifact - fx:deploy is not available in this JDK.
I searched google and found a couple of people with the same issue:
* https://youtrack.jetbrains.com/issue/IDEA-200721 --- here one guy said he managed to build it manually but there's got to be a better way...
* https://stackoverflow.com/questions/53450011/build-and-deploy-javafx-application-using-java11 --- here somebody said that the packager actually got removed from java11 which explains the error and suggested rolling back to Java10 but this didn't work for the guy asking the question...
So I guess my question is given the state of Java/FX 11 how are you supposed to build JavaFX jars from the IDE (packager or no)?
IntelliJ IDEA never had bundled packager and depends on tools provided with jdk/javafx. So when the packager would be restored, IDEA will be able to use it to build javafx artifacts in the IDE.
Thanks for the info, I guess java11 just isn't supported right now. That's fine tho Java 8 worked for me without trouble :)