s
Grzegorz
Level 9
how can I run the code before verifytask in IDEA
Under discussion
Comments (9)
- Popular
- New
- Old
You must be signed in to leave a comment
public enum WaysToDie
21 December 2021, 17:34
Right click on the code window and select Run. This will allow you to run your code before submitting it for verification.
+2
jjopc
21 December 2021, 15:50
I think that you should install JDK 1.8 "Amazon Correto" as the IDE suggest you at the top of the screen, it includes JavaFX. After that I would delete the line 11 "@java.lang.Override". Finally, just in case, you have to delete the import in line 3, "...Game", because the line 4 import includes this one.
After all of this, you should see a play button near the class name in line 6, just "play" your class and it should run.
0
Guadalupe Gagnon
21 December 2021, 15:22
First get rid of java.lang on line 11
Next you have two options to get JavaFX working:
#1 set the VM options properly. You can find instructions on how to online
#2 or, the way that I do it, just create a method in the main class (Game2048 for this task) that calls the launch method. The launch method requires args, just pass in a new String[0]. Then create a new class in the game folder with its own main method that calls the method you just created.
0
Guadalupe Gagnon
21 December 2021, 15:22
Here is a screen shot of the method I created in the Game2048 class:
0
Guadalupe Gagnon
21 December 2021, 15:23
Here is a screen shot of the class I created in the game folder with the main method that calls the new method I created in the Game2048 class:
0
Guadalupe Gagnon
21 December 2021, 15:24
You may need to comment out the added code before trying to validate. I set this up after I had already completed the tasks on all my games projects because the VM options had to be re-set up after every update and that was getting tiresome.
0
Grzegorz
21 December 2021, 15:32
I still have some problem
0
Guadalupe Gagnon
21 December 2021, 16:13
launch() is a JavaFX method. It looks like you may not have that downloaded on your computer. You are going to need to get that and set it up, here is the link to their website: openjfx
Download the SDK for your specific platform (win, mac, linux : 86x/64bit) and then follow the instructions to set it up in intelliJ
0
Guadalupe Gagnon
21 December 2021, 16:26
Once you download it and extract it (I extracted mine to the lib folder where my codegym game tasks are) you just need to link it to the project. Its not too difficult. Just go to File>Project Structure. In that window hit libraries then on the right side you will see a '+' button. Hit that and find where you extracted the JavaFX to and click that 'lib' and hit 'ok:
The pic shows what I was explaining
0