How to change Eclipse project folder structure to Maven/Gradle structure

You can actually do all of this manually with minimal fuss.

  1. In the Package Explorer view, right-click on your src folder and choose "Build Path" -> "Remove from Build Path"
  2. Underneath the src folder, create a main/java folder
  3. Right-click on the main/java folder and choose "Build Path" -> "Use as Source Folder"
  4. Repeat steps 2 and 3 for test/java
  5. Using the Eclipse refactoring tools (right-click on a folder or file and choose "Refactor" -> "Move…", move your Java files to the new folders

Once you're done with the refactoring, your project will be structured in the Maven way. This will make things much simpler when you decide to actually start using Gradle and Maven for your project.

Note that Java will still display your src/main folder separately in the project viewer. This is normal. Eclipse shows your source folder at top and then all other folders in the project view, which include the source folder parents.