nus-cs2113-AY2324S1 / forum

0 stars 0 forks source link

Week 7 Tutorial: Unable to run Duke #25

Closed bnjm2000 closed 11 months ago

bnjm2000 commented 11 months ago

Had trouble following the tutorial as I was unable to run Duke.java after forking and cloning to my local machine. Upon opening in IntelliJ, I get an error message of tp: failed and I do not have the option of running Duke

I am running a 2022 Mac M2 Max with MacOS 13.2 (maybe that has something to do with it)

Anyone facing the same issue? Any help would be appreciated. TIA!

tp failed Duke
okkhoy commented 11 months ago

This potentially happens when the JVM gradle uses and your default JVM conflicts. @exetr can you please post the instructions on how to set the default JVM to Java11?

exetr commented 11 months ago

Could I also ask whether you have previously installed different versions of the Java runtime and if so, have you done anything to swap the active version of Java?

If not, you can try the following steps to try to resolve the issue:

  1. As a sanity check, could you open a terminal and run java -version, verify that the version of Java is set to 11 (adhere to the tP constraints).
  2. After opening the project in IntelliJ, click on the settings button near the top right > Project Structure > Project Settings > Project. Under the SDK, ensure that the matching version of Java you saw in step 1 is selected. For "Language Level" ensure that the corresponding version is set. image
  3. In the same menu, under Platform Settings > SDKs, ensure that there is an entry for the corresponding version of Java. image
  4. Once done, click Apply and OK to close the menu.
  5. Check whether IntelliJ has updated the project to detect Java
bnjm2000 commented 11 months ago

This worked, thank you both so much for your assistance! I can finially upload my screenshots, hope they can still be counted :")