I’m currently working on the FizzBuzz exercise (https://www.codecademy.com/courses/learn-java/projects/java-fizzbuzz). I wrote my code in an IDE and there it gives zero errors and runs perfectly, with the expected output.
Yet when I paste the exact code in the online exercise, save the code and then try to run it from the bash (with the command java FizzBuzz), I get an error: Error: Could not find or load main class FizzBuzz
Caused by: java.lang.ClassNotFoundException: FizzBuzz.
How do I get the exercise to run?