code.makery.ch
code.makery.ch copied to clipboard
Migrate JavaFX Tutorial to Java 9
- [ ] Jaxb works different with the new module system of Java 9. See Comment in Tutorial Part 5
Possible Solution, posted by Andreas A.
Hi Marco, hi Nik
First of all: Thanks Marco for your absolutely amazing tutorial, wow!!
I have the following solution, so it works in Java 9 with the new modules system: You just have to add a file named "module-info.java" in your /src-folder. It should contain the following 'requires' and the following 'opens'-statements, that's all. So, the file "module-info.java" should look like:
module CodeMakery.AdressApp { //noinspection removal requires java.xml.bind; requires javafx.base; requires javafx.fxml; requires javafx.controls; requires java.prefs;
opens ch.makery.address; opens ch.makery.address.view; opens ch.makery.address.model; opens ch.makery.address.util; }
I've done some more detailed explanation on my GitHub. There you can see and download the whole source code of the file including the explanations (and the whole app if you want): https://github.com/AndiSwiss/AddressApp/blob/master/src/module-info.java
Cheers, Andreas A.
I was just thinking about this tutorial the other day; it's where I got started with JavaFX. I came here wondering about updating it to Java 11+.
Is there something that could take JAXB's place that would still allow you to store the data in some format?
@UgmaDevelopment I haven't been following Java lately. Maybe someone else can answer that question.