jQuery in Action, 3rd edition
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse - exporting files in WAR file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse - exporting files in WAR file" Watch "Eclipse - exporting files in WAR file" New topic

Eclipse - exporting files in WAR file

Greg Soulsby

Joined: Feb 01, 2011
Posts: 9
I have my Eclipse project working nicely in dev. (actually myEclipse)

But after deploying to my ISP via a WAR file it fails as it cant find the mail.java class.

Within Eclipse I copied mail.java into /scr. Within the deployed webapp is ends up in /WEB-INF/classes, which is not in the class path.

When I copy or move mail.java to /lib then the app runs.

I put the mail.jar into /lib within Eclipse but it was not copied at all when deployed via WAR file.

So what could be happening that they are not deployed? How come a file in /scr directory ends up in /class when you deploy by WAR?

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 44545
Don’t know. Sorry. I shall move this discussion to our IDEs forum, because that appears to be an IDE-related question.
Richard Bell

Joined: Oct 20, 2011
Posts: 4

Are you using ANT to create your WAR file?
Peter Johnson

Joined: May 14, 2008
Posts: 5852

If you created a Dynamic Web Project, then you should place the mail.jar in WebContent/WEB-INF/lib

JBoss In Action
I agree. Here's the link: http://aspose.com/file-tools
subject: Eclipse - exporting files in WAR file
It's not a secret anymore!