8

I have the following problem:

I have installed e(fx)clipse in Eclipse to enable JavaFX compatibility. It properly created the following:

  • CSS and FXML files are associated with the correct editor (from within 'file associations')

It is not functioning properly, because it lacks to do the following:

  • It shows Unknown property: -fx-.... for every entry in my CSS.
  • It does not autocomplete in both the FXML and CSS files.
  • It keeps showing: The controller 'someController' has no field 'someField', while the fields are initiated in the controller.

What I already tried to fix this:

  • Added JavaFX SDK to the project libraries.
  • Checked the installed software section of Eclipse, but all of the e(fx)clipse packages are correctly installed.
  • Created a new JavaFX project from scratch.

This didn't fix the problem. I think it has something to do with adding the library, because when I add JavaFX SDK and click 'Next', I get a blanco screen and I have to click 'Finish'. When I do, it only adds org.eclipse.fx.ide.css.jfx8. Is this just normal, or should there be more packages?

I am using Eclipse Luna 4.4.1 and Java JDK 8u40.

Any help is greatly appreciated!

greg-449
  • 109,219
  • 232
  • 102
  • 145
bashoogzaad
  • 4,611
  • 8
  • 40
  • 65

3 Answers3

11

To clarify Alex's answer.

I had the same issue of being unable to get auto-complete with my JavaFX CSS. My fix was add the JavaFX SDK to the library list. To do that:

  1. Go to Project | Properties
  2. Select Java Build Path in the tree
  3. Click on the Libraries tab
  4. Click the Add Library... button
  5. Choose JavaFX SDK
  6. Click Next then Finish
  7. Click Apply
  8. Click OK

CSS editing worked after those steps.

Chris
  • 437
  • 5
  • 7
  • Sorry for replying to this 4 year old thread, but does anybody know if I need to add this to the Modulepath or Classpath? Thanks! – Banjer_HD Mar 19 '20 at 17:31
4

I got this problem solved after installing Eclipse web developer tools and Eclipse Java web developer tools.

  • 1
    That solved my problem too, and I also reinstalled Eclipse and its plugins entirely. Thanks!! – bashoogzaad Apr 18 '15 at 11:28
  • 1
    do you mean [Eclipse Java EE Developer Tools](https://marketplace.eclipse.org/content/eclipse-java-ee-developer-tools-0)? I can't find any "Eclipse Java web developer tools" separately, it seems to be a part of the EE Tools. But I installed it and it still doesn't work... – xeruf Oct 24 '17 at 13:25
2

I got the same issue, an before installing packages mention above, I included JavaFX SDK and I put it on top of my "Order and Export". e(fx)clipse start working without any Unknown property and the Auto-Complete starts working as well.

Project -> Properties -> Java Build Path -> Order and Export Tab and put the JavaFX SDK on the top...

mchagnon
  • 21
  • 1