The problem: I strongly suspect WindowBuilder makes my Eclipse crashing under certain conditions. These conditions are:
- the class you're working on it using the
design
tab has to contain some references to a JavaFX code - first time you
design
such class it's all good. Second time you click ondesign
tab of another class of that kind, or click on "Reparse source and refresh design page" icon inside the design view of the first class, Eclipse crashes. Essentially, parsing the code of such classes for a second time is where it crashes.
My context: I'm coding a gui hangman game using Swing and JavaFX libs. I'm aware of the conditions for interoperability between these two guys.
I'm using Eclipse IDE for Java Developers Version: 2021-12 (4.22.0) (the current one the installer installs on your computer). The JDK 17.0.1 (installer on Oracle site for Windows x64) and I'm on Windows 10 x64.
Enviroment variables (JAVA_HOME and PATH_TO_FX) and Eclipse project settings (non modular project is my case) should be ok: my code is compiled, my program runs without troubles, I see the gui and everything is where it should be and working. But to be sure I've tried to reproduce the crash with the code of more experienced people of me for sure (article link, repository link) and it crashes in the same way. I'm gonna post my code if required of course.
I'm using WindowBuilder 1.9.8, the last good build, cause a bug me and other people have encountered (see here, here and here) has been fixed there. Anyway, it crashes even with previous versions.
I'm gonna post a bunch of additional info about logs and crash reports, please skip it to the end if you think there's no need of additional info.
I'm running Eclipse with the -consoleLog
parameter in the .ini file to have the log in a shell window at runtime. This is the relevant part of the log once it ends to load Eclipse:
java.lang.Error: SWT Resource was not properly disposed
and this is what it says when I click on the design tab of a JavaFX referenced class:
com.sun.javafx.application.PlatformImpl startup WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @3d79168b'
but as I said, my project settings should be ok: running configurations -> java application -> main class -> vm arguments:
--module-path ${PATH_TO_FX} --add-modules=javafx.graphics,javafx.controls,javafx.fxml,javafx.base,javafx.media,javafx.web,javafx.swing
Yes, I know there's no need to load all modules, but just to be sure. And yes, I've even read this, but seems like I'm getting this warning anyway.
When I click on the "Reparse source and refresh design page" icon inside the design view, It freezes and have to terminate the process. The crash report says:
"Java was started but returned exit code= -8053063696"
So I looked for it, found this, tried everything (even to unistall the jdk, eclipse including the .p2 folder), but still the same problem
When I try to open the design tab on another JavaFX related class the crash report is different:
"Java was started but returned exit code= 1"
So I've read this, but my enviroment variables should be properly setted and everything should be correctly installed. I've even edit the .ini file to add the reference to the Java Virtual Machine dll, but still the same problem.
My question: can you reproduce this crash? There's a fix or I'm doing something wrong?
p.s. I'm getting the "Wait! Some of your past questions have not been well-received, and you're in danger of being blocked from asking any more." warning here on stackoverflow :( I've read this and I hope this question it's ok