Thursday, January 21, 2010

JavaFX Eclipse plugin error

If you decided to give it a try to JavaFX using Eclipse you may run into your first problem right after installing the JavaFX plugin for Eclipse and it may look like these errors:

Cannot access java.lang.Object class file for java.lang.Object not found
Invalid assignment
Package javafx.scene does not exist
Package javafx.stage does not exist

First of all make sure that you added correctly the JavaFX SDK to your libraries:



If this is correct then take a look at your ".classpath" file and make sure that the JavaFX entry looks like this:

      <classpathentry kind="con" path="com.sun.javafx.eclipse.core.classpath.SDKClasspathContainer"/>  

And not like this:

      <classpathentry kind="con" path="com.sun.javafx.eclipse.core.classpath.SDKClasspathContainer/reserved/desktop"/>  

That fixed it for me ;)