0

I recently made a cool snake game on swing as a personal project to work on (a challenge from my friend), however I was wondering if I could use a more recent GUI toolkit that java had available. That's how I learnt bout' JavaFX. I immediately booted up IntelliJ to see what it was about. Even though all the articles and videos I watched on it said that JavaFX came in the jdk and supposedly the jre as well, whenever I load up a premade JavaFX template (provided by IntelliJ) or import it my self, It doesn't work. Says it can't find anything like "javafx" in my library. I checked the bin and lib folders in my jdk directory and sure enough, there wasn't anything like javafx in there. I scowered the internet for solutions and there wasn't any, so I hoped you guys on Stack could help me. Is it some issue with my jdk specifically or did they remove it for some reason?

Nod
  • 27
  • 1
  • 7
  • 1
    It has been removed from the JDK: "With the release of JDK 11 in 2018, Oracle has made JavaFX part of the OpenJDK under the OpenJFX project, in order to increase the pace of its development." You can find the latest JavaFX details here: https://wiki.openjdk.java.net/display/OpenJFX/Main and you can download JavaFX builds here and add them as a library: https://openjfx.io/ – sorifiend Dec 13 '20 at 23:58
  • 1
    Possible duplicate: [Running JavaFX application with JDK 11+](https://stackoverflow.com/questions/50828975/running-javafx-application-with-jdk-11) – sorifiend Dec 14 '20 at 00:00
  • Note that some vendors (other than Oracle) may bundle OpenJFX in their distribution. – Slaw Dec 14 '20 at 01:06

1 Answers1

2

JavaFX is not part of the jdk since java 11. You can still use it and there is some documentation on https://openjfx.io/. You can also have a look at compose for desktop which is a rather new ui framework. If you're looking for a java game library you might also want to look into libgdx which is more geared towards game development.

Selim
  • 1,064
  • 11
  • 23
  • 1
    Actually, JavaFX has never been part of Java SE. Some vendors choose to bundle it with some versions of their implementations of Java, some do not, and some have changed their minds over time such as Oracle. – Basil Bourque Dec 14 '20 at 00:31
  • @BasilBourque absolutely correct! Some vendors still seem to support it with [newer jdk versions](https://www.azul.com/downloads/zulu-community/?package=jdk-fx) – Selim Dec 14 '20 at 08:12
  • At least two companies bundle JavaFX with their JDK: Azul Systems and BellSoft. Both support current Java, and both have back-ported to Java 8. See [my Answer](https://stackoverflow.com/a/65282246/642706) on a similar Question for details. – Basil Bourque Dec 14 '20 at 08:34