Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 410
user1258361 Avatar asked Apr 03 '12 17:04

user1258361


People also ask

What is META-INF folder in java?

In many cases, JAR files are not just simple archives of java classes files and/or resources. They are used as building blocks for applications and extensions. The META-INF directory, if it exists, is used to store package and extension configuration data, including security, versioning, extension and services.

What is in a meta-INF folder spring?

META-INF is intended to contain the MANIFEST. MF file and the services subdirectory related to the ServiceLoader class, but other frameworks, including Spring, use it as well.

What is META-INF folder Android?

Jar files are used by all types of java applications, they have a specific structure - the META-INF folder contains the manifest information and other metadata about the java package carried by the jar file.


2 Answers

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.

like image 86
JB Nizet Avatar answered Sep 26 '22 16:09

JB Nizet


Basically it has to be in your classpath(under /META-INF/). You can manually enable it in eclipse by configuring properties. If your project is maven based, then it should be automatically picked from /src/main/resources/META-INF/ folder (provided entities are under the same hood).

like image 30
vivek mishra Avatar answered Sep 24 '22 16:09

vivek mishra