JavaFX Project - Some imports are not accessible

285 views Asked by At

I have installed JavaFX into eclipse and created a simple project through:

File->New->Other-> JavaFX-> JavaFX Project

And my project setup is exactly like this:

https://www.youtube.com/watch?v=N6cZcw8_XtM

And I need to parse some XML files but when I try to import the following packages:

import org.w3c.dom.*;
import javax.xml.parsers.*;

I get the error:

The package javax.xml.parsers is not accesible.
The package org.w3c.dom is not accesible.

The thing is, these imports dont give me any error in another java project, this only happens when I create a JavaFX project.

1

There are 1 answers

0
Doğukan Özdemir On

Ok solved my problem

Instead of creating the project like this :

File->New->Other-> JavaFX-> JavaFX Project

I simply created a standard Java project and followed the same steps.

Also, Going to Project Properties->Java Build Path-> Libraries for some reason my openjdk was under Modulepath instead of Classpath , so I fixed that as well.