Eclipse warning: XXXXXXXXXXX.jar will not be exported or published. Runtime ClassNotFoundExceptions may result

后端 未结 3 1476
有刺的猬
有刺的猬 2020-12-08 14:02

I keep getting the following error after I put the required files in my build path on Eclipse. I am working on a Spring MVC Hello World Application and using Eclipse Helios

3条回答
  •  伪装坚强ぢ
    2020-12-08 14:23

    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:

    1. "Drag and drop" the files that I want in my classpath/dependencies into my WEB-INF/lib/ folder;
    2. Right-click on your project in the Package Explorer tab, and build path --> configure build path --> external jars, adding the desired files;
    3. Restarted Eclipse;
    4. Select Project --> Clean…. My system is configured to build automatically, so after this step, the error message was gone, but the warning XXXXXXXXXXX.jar will not be exported or published. Runtime ClassNotFoundExceptions may result remained;
    5. Right-click on warning message --> Quick Fix;
    6. Select the option Mark the associated raw classpath entry as a publish/export dependency. (in the following figure)

提交回复
热议问题