Cannot create FXML file in JavaFX project in Eclipse

11,092

Solution 1

The problem is solved for me by installing the latest jdk 8u73 and by adding the new build path in eclipse

Ps : sorry for my english

Mounir (France)

Solution 2

I solved this problem by referencing the JavaFX library to the project. One way to do that is to right-click the project folder in Eclipse, then select Build Path -> Add External Archive.

The JavaFX archive, named jfxrt.jar is located in the directory jre\lib\ext of your JDK directory.

Surprisingly, the JavaFX libraries are not automatically linked in a JavaFX project... This operation also allows to build JavaFX sample projects, which otherwise don't compile.

Solution 3

I stumbled on this problem because I was under the impression that JavaFX was bundled with Java 8, but that's not true (or maybe not always true) for OpenJDK. Installing the openjfx package solved the problem for me.

Solution 4

I had exactly same problem when using e(fx)clipse 3.0. In my situation, changing to version 2.4 helped to fix solution with creating new JavaFX projects (it generates .java, .fxml and .css files automatically now) and with adding files to existing projects. Just uninstall 3.0 and try 2.4

Solution 5

Hello I fixed the problem for my case, it was by right click on the project name > Build and Path > Add libraries > User libraries then click on next select your JavaFX libraries .

i suggest to watch this video : https://www.youtube.com/watch?v=oVn6_2KuYbM&t=334s

Share:
11,092

Related videos on Youtube

Kas Elvirov
Author by

Kas Elvirov

programmer, musician

Updated on June 04, 2022

Comments

  • Kas Elvirov
    Kas Elvirov about 2 years

    OS: Ubuntu 14.04.
    IDE: (Eclipse Mars.1 Release (4.5.1)) and Scene builder 2.


    I can't choose root element because as I understand it should be done.
    This window I see when creating a file. enter image description here


    Maybe I incorrectly set the path to my Scene Builder executable.
    enter image description here

    How to solving this problem?
    I did everything according to instructions.


    Update 1: Not yet solved the problem, I'll use the Idea IDE
    Update 2: Now i use Netbeans with JDK from ORACLE website. I chose the easiest way.
  • Kas Elvirov
    Kas Elvirov about 7 years
    Thanks. I'll try it

Related