I have been troubleshooting this error for the past few days - and have hit a brick wall. I am running NetBeans v11.3, and Ubuntu Bionic (v18.04.4).
I have installed Java versions 8 and 11 (openjdk) along with source code.
I have also installed javaFx versions 8 and 11 with source code.
I have even gone to "Tools -> Java Platform Manager" and ensured that v8 and v11 of Java are properly installed along with the appropriate "Platform Sources".
But I still get the error mentioned when I try to create a new JavaFX project.
Any help would be very much appreciated.NetBeans JavaFX project create error
I have never tried to use JavaFX on openJDK, try out with Oracle JDK, as far as I know this is the best choice for using JavaFX, also try to edit the default platforms to match the appropiate system paths
Related
I am a beginner programmer and now I want to start GUI applications in java.(as I previously worked on java too). I started reading some books on FX but its not compiling on JDK11 .. Do I need to use jdk8 or is there any way i can do it on jdk11 too?
JavaFX has become unbundled from JDK11 (both Oracle's official JDK and OpenJDK). In order to use JavaFX with JDK11, you'll have to download the standalone JavaFX11 runtime.
I have an assignment for my school that I have to submit that needs you to create a Java application that involves recursion, file read, and javaFx. I have a 15 inch MacBook Pro with an i7 processor. When I try to use JavaFx in a class in Java, I always get errors saying that javaFx.application.Application or javaFx.scene.Scene cannot be applied to a type. Basically, my Java oxygen application cannot run javaFx. I've tried multiple YouTube videos on how to download plugins from oracle and the Java oxygen marketplace. I told my instructor and he hasn't gotten back to me yet. Everytime I download a possible plugin like e(fx)clipse/2.0.0/ (or something like that), Java oxygen sends a message that it cannot complete the operation because new software has already been installed. I kept searching oracle for the latest JDK but javaFx still won't download. I was just wondering if it had to do with me having an Apple and not Windows computer or is there something else I can try. Thanks for your help!
Just go here and download the Mac version of the JDK and install it.
http://www.oracle.com/technetwork/java/javase/downloads/jdk10-downloads-4416644.html
That is all which is technically needed to run a JavaFX application. You should also download and install the latest version of Eclipse (Photon) because it fixes some problems with the latest Java.
http://www.eclipse.org/downloads/index-developer.php
If you like you can also install e(fx)clipse from the marketplace but it is not needed to write JavaFX applications.
I am sure it is simple problem, but I am new to Java and PHP, I want to learn Java, I bought a book, I have also a couple of books as PDF from internet, at the Beginning of the book there is always intructions, how you can install for example NetBeans to start programming. I have installed jdk 8 and NetBeans 8.2.
The problem is, when I start NetBeans, the Buttons for creating new Project not function and is not reacting on my click. I have installed all plugins. I have searched the internet. I have found, that I should click create new Project, I will get a dialogue, then I should choose the desired project. But it shows nothing when I click that button, it simply does not react. Please help me.
It might have been caused by JDK 9. You could have changed the JDK 9 to previous version and it would have worked.
For that you would have to go to:
\NetBeans 8.2\etc
Then you can edit: netbeans.conf . Just change the directory for JDK from 9 to previous version if it is installed. (or install JDK 8 and then do the same process)
I have uninstalled the NetBeans 8.2, which I downloaded it alone from NetBeans website, after that I have downloaded it as a complete package together with Java SDK from Java website, now it functions wonderful
Netbeans 8.2 is bundled with Oracle JDK 8. Just download the installer for your platform and install it. I have tested the installer with Windows 10 and it works like a charm.
I have problem importing import "javafx.util.Pair" into my program.
after searching the net I've found this answer cannot resolve symbol javafx.application in IntelliJ Idea IDE and I've installed desired jar file but still I've problem to import.
this is what I face to when open java jdk.
I don't know the why the "jfxrt.jar" is different.
note the black arrow on the folder icon
open the File | Project Structure dialog, there under Platform Settings select SDKs and then your JDK 1.8. On the right you then see all the jars that make up the classpath to your SDK. Make sure that your jfxrt.jar is in that list, if not, you can add it by clicking the '+' button at the bottom.
Update May 2020
JavaFX is no longer part of the Oracle or OpenJDK default distributions. Instead it is available as a seperate library or module set.
For instructions on using JavaFX in your application, see the documentation at:
https://openjfx.io
For instructions on working with a modern JavaFX installation and Idea, also see the related question:
IntelliJ can't recognize JavaFX 11 with OpenJDK 11
You don't need to "install the desired jar" (whatever that means).
You don't need to do that for JavaFX. You should not do anything explicitly with jfxrt.jar either in the filesystem or by adding it to a project classpath. If doing something on the filesystem, that is especially bad as jfxrt.jar is not made to be standalone and requires related native libraries shipped with the JDK in order to work.
The JavaFX code should be part of the JDK installation you are using. Perhaps you are using a Java version below 8 or an OpenJDK implementation that does not include JavaFX. If so, then install the Oracle JDK 8+ and set idea to use it. Everything should just work then and all of related JavaFX imports will resolve.
I am having problems adding the new JDK 9 Platform to Netbeans. Here are the steps I followed:
I downloaded Java 9 from here: http://jdk.java.net/9/ and ran the installations.
In Netbeans I went to Tools, then Java Platforms
Clicked on Add Platform
Selected Java Standard Edition
When asked to choose the platform folder selected "C:\Program Files\Java\jdk-9"
As Platform Source I selected "C:\Program Files\Java\jdk-9\lib\src.zip"
And for Platform Javadoc I filled in "http://download.java.net/java/jdk9/docs.api"
Now I see that if I click on the new JDK 9 platform Sources and Javadoc seem correct, but classes are empty. When I set a project to use the new JDK9 platform I get a lot of exceptions along the lines of "Cannot find package java.lang".
Who can help?
Thank you
Issue has been solved. The solution was to install Netbeans Daily Development Build instead of the Netbeans 8.2 that I use.