I am taking the University of Stanford algorithms course (via Coursera). This course uses IntelliJ as the programming environment as well as well as some libraries built for the course. In particular, it uses some StdOut and StdIn libraries to deal with standard output and input.
If I just write my code and try to compile it via the terminal, it will throw the eror
error: cannot find symbol; symbol: variable StdOut.
I figured out that the problem can be solved by adding import statements:
import edu.princeton.cs.algs4.StdIn;
import edu.princeton.cs.algs4.StdOut;
However, IntelliJ deletes these statements as soon as I add them. But, if I compile again, it compiles without errors, so it looks like IntelliJ is importing these libraries and then deleting the statements.
The problem is, if I close and reopen the project, and compile again, it gives me again the missing symbol error, which forces me to re-write the import statements.
My question is, I don't like the idea of re-writting these statements every time I close and open the project, I just want to IntelliJ to stop messing with my code and leave the statements in there. Since I'm just a beginner, I want to focus on learning about the algorithms, not on fighting against IntelliJ features, so I'm OK with completely disabling any kind of auto import and I will just handle all the imports manually.
I went to settings/Editor/General/Autoimport and basically disable everything, and yet IntelliJ still deletes my import statements.
Thanks you for your help!