While trying out JavaFX, I'm currently having problems with auto-completion. I have a standard-maven project with Java 8 set as source and target:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
This is correctly recognized, I can use auto-completion for Stream API and so on.
Some threads, e.g. How to Use JavaFX in Eclipse Swing Project, show that jfxrt is necessary for using JavaFX. Eclipse uses the correct JVM under /usr/lib/jvm/java-8-oracle/ and it does find the correct jfxrt.jar in /usr/lib/jvm/java-8-oracle/jre/lib/ext/jfxrt.jar. If I manually open (in the Package Explorer) JRE System Library -> jfxrt.jar -> javafx.embed.swing I see JFXPanel laying there as it should.
Nevertheless, when I hit Strg + Space after the input of JFXPanel
it only tells me to create a class with this name. Even if I write import javafx.embed.swing
it only suggests me to write import javafx.embed.swing.*
instead of any class in this package.
This behaviour seems very awkward to me. Can anyone tell me, why eclipse isn't able to complete this or what I could do to prevent this problem from happening?
Go to project properties -> Java Build Path -> [] -> JRE System Library. Check whether you are using a jdk and not a jre. If using a jre switch to a jdk and the issue will be resolved
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With