title: How to prevent IntelliJ from deleting import statements
body: <p>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.</p>
  
  <p>If I just write my code and try to compile it via the terminal, it will throw the eror</p>
  
  <blockquote>
    <p>error: cannot find symbol; symbol:   variable StdOut.</p>
  </blockquote>
  
  <p>I figured out that the problem can be solved by adding import statements:</p>
  
  <pre><code>import edu.princeton.cs.algs4.StdIn;
  import edu.princeton.cs.algs4.StdOut;
  </code></pre>
  
  <p>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. </p>
  
  <p>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. </p>
  
  <p>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. </p>
  
  <p>I went to settings/Editor/General/Autoimport and basically disable everything, and yet IntelliJ still deletes my import statements.</p>
  
  <p>Thanks you for your help!</p>