Eclipse warning: XXXXXXXXXXX.jar will not be exported or published. Runtime ClassNotFoundExceptions may result
In order to get it to work right, I have to "drop and drag" the files that I want in my classpath/dependencies into my the WEB-INF/lib
folder. It works this way.
For some reason, when I try to do it the right way
Build path → Configure build path → External jars
it just doesn't take them.
The trick is that I have to put the files int my Web App Libraries folder and the only way to do that (that I can see) is to "click and drop" into my WEB-INF/lib
folder. In this way, it automatically shows up in my Web App Libraries.
When adding new jar files, I got two messages on Eclipse's Problems Tab
: one error and one warning. I only solved this problem when combining all previous solutions with an extra step. Here's how I solved it:
- "Drag and drop" the files that I want in my
classpath/dependencies
into myWEB-INF/lib/
folder; - Right-click on your project in the
Package Explorer
tab, andbuild path --> configure build path --> external jars
, adding the desired files; - Restarted Eclipse;
- Select
Project --> Clean…
. My system is configured to build automatically, so after this step, the error message was gone, but the warningXXXXXXXXXXX.jar will not be exported or published. Runtime ClassNotFoundExceptions may result
remained; - Right-click on warning message -->
Quick Fix
; - Select the option
Mark the associated raw classpath entry as a publish/export dependency.
(in the following figure)
Right-click on your project in the 'Project Explorer' tab and go to 'Build path' → 'Configure build path' → 'External jars`, and add all the JARs that you want.