简体   繁体   中英

Adding External jar files in Eclipse for EAR Project

I needed to add external jar files to a EAR Project. I did add but the jar files are not reflecting in the lib directory, it is showing below to lib directory. I added these jar files on right clicking on Deployment Descriptor, Import-> Java EE Utility Jar and choosing to copy from the folder. When I dragged the jar file on the lib directory the velocity jar file gets changed to.ear file in the eclipse project explorer.

I have attached a snapshot of the project explorer. Could you please let me know how to add external jar files to ear project as my EJB requires external jars to be included.

项目浏览器的图像

I have even added classpath for jar files in my EJB manifest file Class-Path: ErpServices-ejb.jar velocity-1.6.4.jar velocity-1.6.4-dep.jar xwork-core-2.2.1.1.jar Looking forward to your reply. thanks.

Add those jars under folder EarContent/lib directly , then all is done.

IE, EarContent/lib/foo.jar will work but EarContent/lib/dir/foo.jar won't.

A similar question: here

Just try project root folder right click properties -> build path -> add external jars

Instead of drag-and-drop, add it to the lib folder manually (outside the IDE), refresh the IDE, right-click the EAR project and in modules and dependencies, make sure that it is included in the lib folder and as a dependency.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM