Getting error while creating JavaFX11 application in Apache Netbeans 10
Asked Answered
S

4

11

i am new to java fx and i have downloaded Apache Netbeans 9 which runs on java 11.

since java fx is shipped separately, i have downloaded openjfx-11.0.1_SDK and followed steps in this link https://openjfx.io/openjfx-docs/#install-javafx

when i try to create java fx application in apache netbeans , i am getting below error

Failed to automatically set-up a JavaFX Platform. Please go to Platform Manager, create a non-default Java SE platform, then go to the JavaFX tab, enable JavaFX and fill in the paths to valid JavaFX SDK and JavaFX Runtime. Note: JavaFX SDK can be downloaded from JavaFX website

attaching screen shot of netbeans 10.

enter image description here

Saxophone answered 4/1, 2019 at 7:29 Comment(4)
NetBeans 9 only supports Java 9 and 10. However, NetBeans 10 supports Java 11.Tsui
Indeed you need NetBeans 10. The same tutorial you mentioned has some indications in openjfx.io/openjfx-docs/#IDE-NetBeans about the type of project you can create. This question has more details.Selfcontained
still getting same error after downloading netbeans10Saxophone
NetBeans 10 has support for Java 11,but you can't create an Ant JavaFX project yet. I mentioned that before in my comment. Both tutorial and linked question show other working solutions.Selfcontained
E
3

This is for the future developers that will stumble on this problem. You can follow this video for Installing JavaFX13 and integrate it with Apache Netbeans 11.2. Try following the instructions here

There might be problems with CSS autocomplete but you can create a JavaFx project now.

Edited: As suggested from the other answer, you can download the JavaFX from the official page of JavaFX.

Erminiaerminie answered 8/2, 2020 at 16:13 Comment(0)
C
0

I had the same issue on Netbeans 11. I solved this issue by following below steps.

  1. Download the javafx.zip file from the website and after downloading it put it on JDK folder.

  2. First, click on Manage Platforms and then click on Add platform and after clicking on Add platform it will ask of the filename, so give the path till JDK folder.

  3. After giving path click on next and it will ask for platform name and platform sources so in platform sources give the path till src.zip (jdk/lib/src.zip) and press finish button.

  4. After finishing button, you will see the new platform is added with the same name you have given platform name then click on it and go-to sources and click on Add Jar/Folder button and give the path till javafx.zip file which is saved on JDK folder.

  5. After giving path click on add Jar/folder and close it. After closing it click on JavaFX platform and in that you will see the platform name is there click on it and create the project.

Cistercian answered 3/8, 2019 at 17:44 Comment(0)
D
0

The problem is fixing by jdk1.8. Download and install at the page - https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html for your platform. For me, it was "Linux x64 Compressed Archive"(https://download.oracle.com/otn/java/jdk/8u241-b07/1f5b5a70bf22433b84d0e960903adac8/jdk-8u241-linux-x64.tar.gz)

after that:

setting up 1

setting up 2

Dockage answered 12/4, 2020 at 13:7 Comment(0)
V
0

It may be too late, but I figured it out nonetheless. You, and all other people reading this while trying to figure out how to use JavaFX with any Apache Netbeans version should:

  1. create a new Library, name it JavaFx and in it, put all the .jar files(not the src.zip file) inside the lib directory of the unzipped javafx installation.

  2. create a new normal java project. Go to project properties, and to module path, add the library JavaFx.

  3. create a new module-info.java file (netbeans automates it) in that project and in it, you should put a dependency to all of the JavaFx components, if netbeans didn't already do that (in my case, it did. I didn't even have to hand code a single dependency). And yes, declare the module as "open module".

In essence, I just told you to modularize your project

Valkyrie answered 20/11, 2021 at 10:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.