title: Error: Main.class found in top-level directory (unnamed package not allowed in module)
body: <p>Trying to update an application to Java 11 and after sorting through hell with modules I thought I had got rid of all the red errors and now I'm getting this one I've never seen before:</p>
  
  <p><a href="https://i.stack.imgur.com/FtSx2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FtSx2.png" alt="enter image description here"></a></p>
  
  <p>Looking around I've seen people suggest it is possible to do with the application structure:</p>
  
  <p><a href="https://i.stack.imgur.com/nhlw6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nhlw6.png" alt="enter image description here"></a></p>
  
  <p>or the module-info.java file:</p>
  
  <p><a href="https://i.stack.imgur.com/qtTO5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qtTO5.png" alt="enter image description here"></a></p>
  
  <p>Can anybody see what I need to do to get rid of this?</p>
  
  <p>Edit:
  Error after moving Main.java to a package called 'main' and trying to run it:</p>
  
  <p><a href="https://i.stack.imgur.com/GrSBM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GrSBM.png" alt="enter image description here"></a></p>