I'm trying to get some java 1.8 code working in Java 11. I've hit what seems to be a common wall, but none of the answers I've found are working.
System: Fedora 33 5.9.8-200.fc33.x86_64
Eclipse Version: 2020-09 (4.17.0) Build id: 20200910-1200
JDK: java-11-openjdk-11.0.9.11-0.fc33.x86_64
JavaFX: OpenFX javafx-sdk-11.0.2
Here's the bit of code that's blocking me.
class MyPie extends PieChart {
public Legend legend;
public MyPie() {
super();
legend = (Legend) getLegend();
}
}
The error is: "Legend cannot be resolved to a type" When I ask Eclipse to auto-generate an import statement, or use the suggestion, it put in this line:
import com.sun.javafx.charts.Legend;
This is a problem, because that doesn't seem to exist and doesn't follow the same pattern as the other JavaFX imports:
import javafx.scene.chart.PieChart;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TextField;
I have a second one "com.sun.javafx.css.StyleManager" which I'm guessing will have the same solution.
What am I missing here?
Thanks.