Reputation: 6634
I'm trying to create a OSGI JavaFx project in Eclipse. I get the following errors (Commented out below)
import org.eclipse.fx.ui.theme.AbstractTheme; // The import org.eclipse.fx cannot be resolved
public class DefaultTheme extends AbstractTheme { // AbstractTheme cannot be resolved to a type
public DefaultTheme() {
super("theme.default", "Default theme", DefaultTheme.class.getClassLoader().getResource("css/default.css"));
}
}
How can I get the imports to work right?
I installed e(fx) on my Eclipse to help with JavaFx development.
e(fx)clipse
e(fx)clipse is an Eclipse plugin to author JavaFX 2.0 application
Copyright (c) 2011-2012 BestSolution.at Systemhaus GmbH. All rights reserved.
UPDATE
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode, sharing)
Upvotes: 0
Views: 1791
Reputation: 111
First step with "Import cannot be resolved" errors in Eclipse: re-create the Eclipse project.
mvn eclipse:eclipse
or your equivalent. Then refresh the project in Eclipse to see if it's still happening.
EDIT: This person seems to have had the same problem and fixed it: e(fx)clipse The import of javafx cant be resolved
There also this:
Some javafx classes cannot be resolved in Eclipse using Java SE 8u25
Hope it helps.
Upvotes: 0