-1

I am working on a small Java/JavaFX application for some training purposes and have run across a problem that I can't seem to resolve. My application runs just fine, but when I try to run it in the debugger, the debugger encounters a ClassNotFoundException. It doesn't appear to give me any information on what class it is looking for. The debugger stops in **BuiltinClassLoader **and the class is null, which makes sense. I am not currently providing any code here because I don't know where to start. Can someone provide me with some troubleshooting strategies for fixing this problem? I really want my debugger back!

Thanks for any assistance.

IntelliJ IDEA 2022.2.3 (Community Edition) Build #IC-222.4345.14, built on October 5, 2022 Runtime version: 17.0.4.1+7-b469.62 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 32

Kotlin: 222-1.7.10-release-334-IJ4345.14

java 19.0.1 2022-10-18 Java(TM) SE Runtime Environment (build 19.0.1+10-21) Java HotSpot(TM) 64-Bit Server VM (build 19.0.1+10-21, mixed mode, sharing)

Here's what I see in the debugger window:

enter image description here

  • 1
    Make sure that all necessary classes and libraries are included in your classpath. – Ruslan Zinovyev May 11 '23 at 15:24
  • 3
    Surely if you expand the exception in the debugger pane on the right, it will show you the message? That should include the information as to which class it can't find. – James_D May 11 '23 at 15:25
  • I've drilled down into all the things listed in the debugger window but have found nothing that indicates what is missing. – user1886924 May 11 '23 at 18:42
  • @RuslanZinovyev if they are JavaFX classes that aren't being found, they should be on the module path and added to the module system (via VM args or module-info). Modern JavaFX distributions are not designed to be run from the classpath and doing so may cause issues. For further info [see the JavaFX getting started documentation](https://openjfx.io/openjfx-docs/). – jewelsea May 11 '23 at 21:31

1 Answers1

0

One possible cause is that you are using a JDK version that does not include JavaFX (JDK > 9). In that case, you need to download and add the JavaFX library to your project. You can follow the instructions here: https://openjfx.io/openjfx-docs/#install-javafx

  • I understand your comments but how does that make sense when the project works just fine outside the debugger. If some class was missing, it should fail there too. Correct? – user1886924 May 11 '23 at 18:40
  • @user1886924 [idea uses different execution profiles when a debugger is used and when it is not](https://www.jetbrains.com/help/idea/run-debug-configuration.html). If you don't have the same VM args (to configure the Java module system) applied to the debug configuration as the run (without debug) configuration, then classes may not be found. – jewelsea May 11 '23 at 21:37
  • If the project is made modular (by providing a module-info that requires the necessary JavaFX modules), and a build tool (like Maven) is used to put dependencies on the module path, then VM args for modularity don't need to be provided, which can simplify setup. – jewelsea May 11 '23 at 21:37
  • Various options for modular and non-modular projects with your selected IDE are provided in the documentation linked in this answer. However, the easiest setup is via the [new JavaFX project wizard in Idea](https://www.jetbrains.com/help/idea/javafx.html). – jewelsea May 11 '23 at 21:38
  • As your image mentions you are using WebView, [this answer may help](https://stackoverflow.com/questions/70942561/can-not-resolve-symbol-javafx-scene-web/70946444#70946444) (maybe this question is a duplicate of that). – jewelsea May 11 '23 at 21:42
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 11 '23 at 23:56