I wrote the program for the task 07.20 Shuffled just in time, but when I try to debug or run the program I get an error but from another program, 07.25. What is going on?
Trying to debug or run solution but when I press the corresponding buttons, I get a compilling error from another exercise (number 25) from this level. What is going onnnnnn? :(
You must be signed in to leave a comment
29 October 2020, 17:04
The reason is that CodeGym tasks are all one big project. Any compile time errors in one part of the project is going to prevent you from running any parts of the project. Comment out line 11 of the problem class for the time being so you can continue working. Compile time errors are the ones where you get the red squiggly lines from, things like using uninitialized variables, spelling mistakes, or forgetting a }. Not to be confused with run time errors which are errors that occur during the running of the code, where an Exception is thrown because of things like a divisions by 0 or accessing indices of arrays that are less than 0 or greater than the length.
29 October 2020, 17:21
Hi Guadalupe, what I ended up doing was to solve the task that was giving out errors and after that I was able to continue working on my current task. It was a very strange behavior because I had not worked on task 25 before and had already solved another task from this batch earlier without any issues. I tried commenting out the line you mentioned but then it resulted in another error because that line was needed. Anyway, thanks for the quick reply!
29 October 2020, 17:01
To be honest, I don't know much about the configuration of the Intellij-debugger, but the behaviour you describe closely resembles the way that the standard run-configuration is handled in IntelliJ. (Here's a link to a discussion of the run-config, the short version: By default, Intellij runs the last / previous run-config that you have executed and does not automatically update this config when you switch to another file/folder)
29 October 2020, 17:22
Hi horst, I see what you mean but the problem is I did not open that problem before. Hmm very strange anyway, I have managed to solve the issue, check the reply above. THank you! :)