Description
The “Calculator Conundrum” exercise fails to compile because the IllegalOperationException.java
file is redirecting to another file with the same name in a different directory, leading to compilation errors.
> Task :concept:calculator-conundrum:compileJava FAILED
(source = exercises/concept/calculator-conundrum/.meta/src/reference/java/CalculatorConundrum.java; exercises/concept/calculator-conundrum/.meta/src/reference/java/IllegalOperationException.java)
exercises/concept/calculator-conundrum/.meta/src/reference/java/IllegalOperationException.java:1: error: illegal '.'
../../../../src/main/java/IllegalOperationException.java
^
...
5 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':concept:calculator-conundrum:compileJava'.
> Compilation failed; see the compiler error output for details.
Problem Details
The issue stems from the IllegalOperationException.java
file located at:
exercises/concept/calculator-conundrum/.meta/src/reference/java/IllegalOperationException.java
This file contains a redirection path:
../../../../src/main/java/IllegalOperationException.java
This redirection appears to reference a file outside the exercise’s directory structure, causing the compilation errors.
Suggested Resolution
- Replace the redirection in the
IllegalOperationException.java
file with the appropriate exception class definition as it is in thesrc/main/java/IllegalOperationException.java
file.
Outcome
After making the suggested changes, the build was successfully completed, and the compilation errors were resolved.
If anyone has additional suggestions or a different approach to resolving this, please feel free to share! I’d love to hear your thoughts.