0

On my previous laptop, I could easily create a JavaFX app from IntelliJ's JavaFX template. Although I have a new better computer, If I repeated the process, IntelliJ would tell me the JDK does not have JavaFX.

Keep in mind that I'm a starter, so I would appreciate it if you could give me answers that do not involve maven or gradle.

I've tried Oracle JDK 11, Zulu OpenJDK 8 and OpenJFX 11.

This solves part of my problem, however, the problem is that I cannot add the JavaFX JDK as JDK. If I try to add the lib folder as a library it says some components are missing.

Elyas Hadizadeh
  • 3,289
  • 8
  • 40
  • 54
Skwead
  • 41
  • 5
  • See https://openjfx.io/openjfx-docs/#IDE-Intellij – José Pereda Jul 23 '19 at 10:22
  • Possible duplicate of [IntelliJ can't recognize JavaFX 11 with OpenJDK 11](https://stackoverflow.com/questions/52467561/intellij-cant-recognize-javafx-11-with-openjdk-11) – Elyas Hadizadeh Jul 23 '19 at 10:50
  • @JoséPereda I watched the tutorial and whatever I did I could not add the jdk, IntelliJ said `selected directory is not a valid home for a jdk`. And my problem is different from https://stackoverflow.com/questions/52467561/intellij-cant-recognize-javafx-11-with-openjdk-1, althought it solves a part of it, in my case I cannot even add the jdk, wich is the first problem I'm facing. – Skwead Jul 23 '19 at 11:00
  • @Skwead Can you create a simple command-line Java application. It is a good idea to share the location which you are pointing to(maybe screenshots). From Java 11, JavaFX is not part of JDK and you must add its libs to your application. – Elyas Hadizadeh Jul 23 '19 at 11:10
  • I made the HelloWorld classic and it worked perfectly. I put my JavaFX jdk 11 at `C:\Program Files\JavaFX-SDK\openjfx-11.0.2_windows-x64_bin-sdk\javafx-sdk-11.0.2`, and my Java11 jdk is at `C:\Program Files\AdoptOpenJDK\jdk-11.0.4.11-hotspot`. As I said, if I add libraries there are still missing components, even on the plain JavaFx template. – Skwead Jul 23 '19 at 11:16
  • @Skwead I am pretty sure that you did not follow instructions properly. Check this video, It might be helpful: https://www.youtube.com/watch?v=82QcFSstJs0 – Elyas Hadizadeh Jul 23 '19 at 11:44
  • Many thanks @ElyasHadizadeh, that video helped a lot, but I had to watch the next one too: https://www.youtube.com/watch?v=WtOgoomDewo, where it is taught how to setup the project. Many thanks to everyone that helped me. – Skwead Jul 23 '19 at 13:49

0 Answers0