Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

import javafx can not be resolved

I am using Windows 10 64-bit and eclipse java 2019-06.I have installed jdk 12.0.2 and jre 8u221. I have set environment system path in environment variable to C:\Program Files\Java\jdk-12.0.2\bin.I can easily compile and run java file in windows command prompt. I can not import javafx.

I have used e(fx)clipse (javafx1 in the following picture). I have also tried adding jfxswt.jar into external library(javafx2 in the following picture).

enter image description here

like image 856
user11862325 Avatar asked Oct 17 '25 02:10

user11862325


1 Answers

As per this article, Future of JavaFx

Starting with JDK 11, Oracle is making JavaFX easier to adopt by making the technology available as a separate download, decoupled from the JDK.

As you mentioned, you are using JDK 12.0.2. JavaFx library are no longer part of JDK, they need to be added separately. Here you can find official documentation on how to proceed with JavaFX 12 development Install JavaFx

like image 101
Shrikant Havale Avatar answered Oct 18 '25 16:10

Shrikant Havale



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!