title: Java: How to move classes to another package in Idea Intellij?
body: <p>I have the following file sctructure:</p>
  
  <p><code>name1/name2/name3/name4 (must be project's root and git root)/src/main/java/com/fileinside1/fileinside2/fileinside3/init/woodenStone</code></p>
  
  <p>Inside the last folder (<code>woodenStone</code>) my <code>.java</code> files are located. </p>
  
  <p>The IntelliJ Idea makes everything look like this:</p>
  
  <pre><code>name4
    src
       main.java.com.fileinside1.fileinside2.fileinside3                             
                 init.woodenStone
                        SomeFile1.java
                        SomeFile2.java
  </code></pre>
  
  <p>And inside every file there is a </p>
  
  <p><code>package main/java/com/fileinside1/fileinside2/fileinside3/init/woodenStone;</code> </p>
  
  <p>as the first line.</p>
  
  <p>So, the files are located in package which starts with <code>main</code> folder. But I need the package to be</p>
  
  <p><code>com/fileinside1/fileinside2/fileinside3/init/woodenStone</code>,</p>
  
  <p>to get a little deeper inside.</p>
  
  <p>So far I only manage to do so by manually changing the package name in .java files, <code>Alt+Entering</code> it and selecting "Move to package com/fileinside1/fileinside2/fileinside3/init/woodenStone".</p>
  
  <p>But I have more than 50 files and would really appreciate a way to do it for all files at once.</p>
  
  <p>Could anyone please tell me if there is such a way?</p>
  
  <p>EDIT: Just found out that even the way I use doesn't really work right. Instead of moving file's into deeer project's folder, Idea just creates a second <code>com</code> folder inside <code>src</code> (How does it even manage to create a floder with the same name?).</p>