Search code examples
eclipsekundera

Where do I put META-INF in Eclipse?


I'm using the Kundera tutorial at https://github.com/impetus-opensource/Kundera/wiki/Getting-Started-in-5-minutes. Eclipse does not find it when I create a folder META-INF at the project root and place persistence.xml in it.

I did a quick search and there was no real solution posted.

There is no valid reason why a simple file path should be difficult to configure. I'm looking for a simple answer to what should be a simple issue.


Solution

  • It shouldn't be at the project root, but directly under the source folder.

    At runtime, the persistence.xml file is searched in the classpath, under META-INF. So if you want the META-INF folder to be put at the top of the compiled package tree, you need to put it at the top of the source tree. Eclipse copies every non-Java file to its output directory (bin, by default), respecting the package/folder hierarchy.