Common Java problems and solutions
- "Cannot find or load Main class XXX" - this is often caused by
the Java compiler (
javac
) being a different version than the
Java runtime (java
). To fix:
- Use the Windows menu to open the Windows Settings panel.
- Type "variable" in the search box to open Edit the system variables.
- Click on the Environment Variables button.
- In the bottom, System variables section, double-click on Path.
- Select
C:\bin\Java\jdk-11.0.1\bin
(or the equivalent;
this is the version you installed when installing JavaFX) and click on the
Move Up button to move it to the top of the list. It needs to be
closer to the top than the Java folder created by Oracle.
- Click on OK until all of the windows are closed.
- Reboot your computer.