Joehot200
Joehot200

Reputation: 1090

JavaFX import unrecognized?

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.

enter image description here

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

Answers (3)

user12566462
user12566462

Reputation:

I found the solution to this problem. Please refer and download the jdk 1.8 and installed.

Upvotes: 1

SnakeDoc
SnakeDoc

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

DeepInJava
DeepInJava

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

Related Questions