I finished the whole thing (verification works) but when I try to run the game there's this error:
Error: Could not find or load main class com.codegym.games.minesweeper.MinesweeperGame
Caused by: java.lang.ClassNotFoundException: com.codegym.games.minesweeper.MinesweeperGame
I am wondering if I did something wrong when trying to run it but it seems to look fine before I do it.
Any ideas?
This may be stupid but it's frustrating
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Odhran
23 October 2020, 23:38
So I imagine this is fairly similar if your using windows, the following worked for me on Linux Mint:
Download javafx from here:
openjfx
As I initially I got the following exception:
"java.lang.module.FindException: Module javafx.base not found"
I've referenced in part the instructions from openjfx-docs but added in some useful extra steps so that it incorperates the Codegym Game library:
Within your file directory
1.Extract the contents of the javafx sdk zip file into the "/home/cobud/CodeGymTasks/8.Games/src" folder.
2.Go to the "CodeGymTasks/8.Games/lib" folder and copy the "desktop-game-engine.jar" file into the "MinesweeperGame/src/javafx-sdk-11.0.2/lib" folder.
Within IntelliJ
3.Go to "File -> Project Structure -> Libraries" and add the JavaFX SDK as a library to the project.
Point to the lib folder of the JavaFX SDK.
4.Go to Preferences (File -> Settings) -> Appearance & Behavior -> Path Variables, and define the name of the variable as PATH_TO_FX, and browse to the lib folder of the JavaFX SDK to set its value, and click apply.
5.Next click on Run -> Edit Configurations and add this line:
--module-path ${PATH_TO_FX} --add-modules javafx.controls,javafx.fxml
If you want to setup your your own test version in intelliJ, go "File -> New -> Project", select Java FX, click next, name it, click finish, follow steps 1-5 and amend the file locations to the Java Fx project src folder.
Hope this helps
0
Guadalupe Gagnon
5 December 2019, 16:19
Wouldn't be able to help without seeing your whole code
0