I've been banging my head on this one for ages and all of the tutorials I've found don't seem to work. When I try to create a new JavaFX project in Netbeans 14, using JDK 18 and the latest JFX download for Windows here:
https://gluonhq.com/products/javafx/
Also tried with JDK and JFX 17 and still no luck. I get this error:
I've added the libraries like so:
If I try to add the platform folder, it won't let me progress through the dialogue:
I can't find solutions to this anywhere and, again this is the same with JDK 17 and 18, and JFX 17 and 18. I've checked the documentation and there's nothing that seems to solve the issue.
It says to go to the JavaFX tab and enable JavaFX, but there's no JavaFX tab... Unless they mean this:
But if that's it then, as you can see, it's already enabled and it's still not working. I'm totally lost. I don't understand why the documentation is so poor for FX, for every IDE. It's honestly like they don't want people to use it and every tutorial I'm finding is using outdated versions of NetBeans, the JDK and JFX D-: (they also don't solve the issue even if I do follow them).
If anyone could help guide me, I'd really appreciate it.
I would suggest you go to New Project -> Java with Maven -> either Simple JavaFX Maven Archetype(Gluon) or FXML JavaFX Maven Archetype(Gluon). Use the POM to change your version of JavaFX from the default to whatever version you like. I also use the POM to change the JavaFX-Maven-Plugin to the latest version.
I strongly endorse the approach using maven suggested here. This project started exactly the same way; I'd welcome learning of any issues you encounter.
Alternatively, follow the steps outlined in JavaFX and NetBeans: Non-modular projects: IDE. You've created a JavaFX library, but "Don't try to create a JavaFX project." Instead, choose Java with Ant and Java Application to create a new project, shown below, then follow the remaining steps carefully. It's a convenient alternative for a scratch project while you assay maven.
Addendum: The ant code for a JavaFX project, not selected in the image above, may attempt to package dependencies that are no longer required. In particular, a project using module javafx.web may fail with the following error, seen here and here. The easiest fix is to recreate the Java application by choosing Java Project with Existing Sources.
Unable to create javax script engine for javascript.
Alternatively, a simple example using a custom ant script is cited here.
Related
I've come back to project after a long diversion, and upgraded tooling. This means Netbeans 12.5, Java 17, Gradle 7.3… at least allegedly. For some reason, despite setting the Gradle version to 7.3, it appears to build with 7.0.
Per the image below, setting the Gradle version to 7.3 doesn't seem to be picked up. (That is immediately after hitting Apply.) It still tries to build with 7.0. And – for some indeterminate reason – it can't.
Restarts don't help; I can't get the configuration to be picked up. (Searches for reference to similar issues provide 5-year-old answers that are no longer relevant.) I've even tried deleting the 7.0 distribution; to no avail, it comes right back.
Can anyone provide guidance on getting this to work properly?
Netbeans 12.6 fully supports Java 17 and Gradle 7.3. Gonfiguring the Gradle wrapper for 7.3 gets picked up correctly, eliminating all errors I was experiencing.
Don't bother with gradle in Netbeans. It's a horrible, buggy disaster and 12.6 just seems to want to up the ante.
Netbeans does NOT support gradle in a meaningful way for normal users.
You now get complex multi-projects whether you want them or not.
When creating a Java Application you don't get a choice at what the Main class is called. It will be App with app.java and you will like it.
If you try to rename app.java to something useful. It will not change "Class App" to "Class Useful" it will instead change it to "ClassUsefulp". It will not rename the test file and you will be left with several syntax errors that you can have fun cleaning up.
No, you cannot rename the subproject itself. That will continue to be the extremely descriptive and useful "app" subproject. The IDE will not provide you a way to rename that.
There is no meaningful, intuitive way to create/delete/modify subprojects.
If your gradle version is somehow out of sync there is still no useful way to reset/recreate the gradle wrapper other than creating a whole new project and moving your source code over to the new project.
Oh, so you gave in and accepted the multi-project structure. You noticed that if you go through the multi-project creator GUI then you can create multiple subprojects. Yeah, good luck with that. They won't have gradle build.scripts or wrappers. You won't be able to build your awesome creation.
Want to use command line arguments? Forget it. There is no "run" element in the project properties. You cannot create different run configurations.
Want dependencies? Or any other project configuration? It's all manual editing of gradle files. There's no GUI to assist non-gradle-wizards.
Yeah. you can probably work around a lot of this by dropping to a command line shell and editing the gradle scripts/files manually and running gradle commands manually. A) you're going to need to be a gradle wizard, and B) why are you using an IDE in the first place? you've got gradle, you've got vi available. Bathe in the nostalgia because you'll have to anyways.
Do you like the idea of gradle? Do you use Netbeans? Stick with Ant, or Maven if you need external dependencies; you'll thank me later.
I am very new with netbeans. I was following an introduction course which shows how to Bind jLabel to a jslidebar.
The course shows netbeans 7 and I found similar samples with 8.x.
Steps
Add jslidebar to a form.
Add jLabel
Right click on jLabel
Click on Bind
I have installed netbeans 9 and 10 in two different machines but "bind" option is not in the menu or in another menu. Or at least, is not easy to be found.
Was it option renamed or removed on ver 9/10? Is anything missing in my installation?
Thank in advance for all.
Regards
The first results of my investigation are that Netbeans 9+ has dropped the use of beansbindings.
This is what pull request #300 on the netbeans github repository seems to indicate.
You can still compile an older (Netbeans 8) project after downloading the org.jdesktop.beansbinding jar from the maven repository for example, and adding it as a JAR dependency to your project. However, you won't be able to edit the bindings themselves using the Netbeans 9+ UI.
I haven't yet found a way to replace this with an equivalent solution. I tried reproducing what PR#300 mentioned above is doing, but that doesn't seem to work properly (at least with Netbeans 9 and JDK 9.0.4).
I'll edit this response if I do find a neat way of doing this.
I have decided to try out Vaadin Touchkit for mobile application development, and am trying to get it installed and working on an example app. I have Windows 7 Pro, eclipse Luna, and maven. I'm happy to use something besides Maven, anything to make it work more easily.
The instructions say I can create a Vaadin project and then modify it to be a Vaadin Touchkit project. So I create a Vaadin project, using the Vaadin eclipse plug-in 3.0.0.
Step 1 in a list "After creating the project", says "Install the TouchKit library in the project by including it in the ivy.xml, as described in Installing as Ivy Dependency, and compile the widget set.
I think it odd that we're switching over to ivy from Maven, but ok. I go to the link indicated by the italics above, and find:
Include the following declaration inside the `dependencies` section in the `ivy.xml`.
But there is no ivy.xml file. I searched the whole directory tree. I know even less about ivy than I do Maven, so I dig around a little and find that ivy.xml is supposed to be in the WEB-INF/lib directory. But there is no such directory.
I suppose I could create an ivy.xml that contained nothing but the lines given in the instructions, but feel like trial-and-error in this kind of situation is not likely to be fruitful. Is there something else I was supposed to do to get ivy.xml in my eclipse Vaadin project? Is there some other way to get the TouchKit jar(s) on the classpath? Aren't I supposed to have a WEB-INF generated somewhere?
I presume others have gotten the TouchKit example to work in eclipse somehow -- if they can point me to a different way that does work, that'd be fine, I don't have to fix this one...
Hm, lacking of Ivy.xml is very very old bug known by vaadin team. No one knows why sometimes it wont create it.(Maybe after some n-times attempts of recreating it may fix this).
Unluckily, you have to deal with maven
Has anyone managed to get Bck2Brwsr working together with Java 8 / JavaFX 8 lately? Is there a chance of compatibility? I couldn't find much information about it and lack of a good starting point. With the given Maven archetype I get several compilation errors.
How could a minimal project setup look like that actually works? (I'm using Eclipse)
You can follow these instructions: https://groups.google.com/d/msg/bck2brwsr/Ck_FF-V-rlA/j8DnLo7hAfkJ
You can use M2Eclipse to use Maven in Eclipse.
Hi i've been trying to install the library on Thinking in Java book 4th edition and i hit a very thick brick wall. I've done everything that the guide from the website told me to do and i still can't get the library to work. From what i've read it seems that the problem is from the build.xml files. having no xml knowledge I am clueless about how I have to modify it in order for it to work. In both cmd and eclipse I am getting these error
c:\TIJ4\code\build.xml
Build Failed
c:\TIJ4\code\build.xml:59:J2SE5 required
Can anyone tell me what I should do ?
I am using eclipse if there is a simpler solution by using eclipse rather than ant please help me out. It's been a week now and I still can't make it work.
The important thing to do is to realize that your ant file has a specific java requirement.
Something to try that might fix this very easily : I believe you can remove any references to a specific JDK, and if you have a reasonably up to date JDK, the build will succeed.
The definete fix : Look into the exact (line 59) of your build file, and try to satisfy the java version that line requires. Java is generally backwords compatible -- something designed to run in J2SE5 should run in the latest JDK. Its not terribly difficult to update your JDK (just google for instructions on your OS).
The most common mistake I see is that people who have the java run time installed believe they also have the Java SDK as well.
Does this "install the library" means you want to look at the code and run them in your eclipse? If so I can share my experience with you.
First run the Eclipse.py script; this will add package info to the source code
Create a new Java project in Eclipse, and then just copy all the source code folders to the src source folder in eclipse, these folders will then be recognized as Java packages.
You should be able to run the classes with a main function.
You can also configure which java version to use for this project in Eclipse build path. 1.5 or higher will work.