Reputation: 1090
I would like to use JavaFX for my game's start screen.
However, for some reason, the import "javafx" does not seem to be recognized.
At first, I (for some weird reason) thought I needed e(fx)clipse, however I successfully installed that and it does not fix the issue. I have found nothing else on the internet that fixes the issue.
Do I need to import javafx as a library or something? And if so, where?
Thanks!
Upvotes: 0
Views: 209
Reputation:
I found the solution to this problem. Please refer and download the jdk 1.8
and installed.
Upvotes: 1
Reputation: 14351
Even in Java7, the javafx jar is included, but not in the classpath by default (you need java8 for that).
So, you could just copy the jfxrt.jar from your java installation's /lib directory into your local project's includes, and add it to the classpath there (ie. java -cp .*:lib/*
)
Upvotes: 2
Reputation: 1951
You might probably missing right version jdk in your classpath.
above JDK 7u6 versions have JavaFX included with the standard JDK and JRE bundles so you can download it from Oracle website. Here is the link:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Upvotes: 1