0

I'm trying to build jar for javafx desktop application. Working in IntelijIdea, jdk 12,using javafx12, link javafx sdk, write VM-options in menu run-edit configuration. In IDE all working correctly, my app launches and works. But when I try to create artifact and then build it to jar all brokes. IDE tell, that fx:deploy isn't there. Then my app don't work even in IDE. I got stuck here.

Can you, please, help, how to build this javafx to launch it without IDE?

p. s. Know, that in jdk8, where javafx still includes, it's easier, but is it really no other way to create independent from IDE javafx, than using jdk8?

Built GUI with swing, created artifact and then built it to jar. There wasn't problems. But I don't want swing...

actual error: "Error. Java FX Packager: Can't build artifact - fx:deploy is not available in this JDK.

Will be really greatfull for tricks or tips with that.

zxc
  • 1
  • 1
  • Please add the actual error to the question. – Boris Sep 19 '19 at 16:12
  • Why jdk 12? It's [EOL](https://www.oracle.com/technetwork/java/java-se-support-roadmap.html#JavaSESupport). – Boris Sep 19 '19 at 16:31
  • done. actual error is: actual error: "Error. Java FX Packager: Can't build artifact - fx:deploy is not available in this JDK". – zxc Sep 19 '19 at 16:43
  • yeah, I know, it's not in JDK now. But isn't that possible to add external library to jar? JavaFX now is under Gluon, and there is sdk 13 version now, so, I thought, there are other ways, than using jdk8. – zxc Sep 19 '19 at 16:48
  • That's right, you shouldn't be using EOL versions. Then why don't you try JavaFX 13? Also I recommend to use Maven to be IDE agnostic. Just follow **Non-modular with Maven** [documentation](https://openjfx.io/openjfx-docs/#IDE-Intellij). – Boris Sep 19 '19 at 16:52
  • Actually, I do... I use javafx-sdk13... Maven - yeap, it's variant, thank's, if I don't find any other solutions in recent time, I'll try it. But... IDE launch it, it works with jdk12, so there is some magic, which helps. I hope... – zxc Sep 19 '19 at 17:25
  • The only issue is to build independent jar includes javafx. – zxc Sep 19 '19 at 17:33
  • 1
    You can create a fat JAR, though note some JavaFX modules depend on platform-specific code. Also see tools such as `jlink` and `jpackage` (available with JDK 13). – Slaw Sep 20 '19 at 03:29
  • yeap, thank's. fat jar, jlink and jpackage, I'll try. – zxc Sep 20 '19 at 15:58

0 Answers0