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

≡放荡痞女 提交于 2019-11-27 19:39:44
Mike

Ok. So I figured it out. . .

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 WEB-INF/lib file.

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 doesnt take.

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 file.

This way it automatically shows up in my Web App Libraries.

Erick

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. "Drop and drag" the files that I want in my classpath/dependencies into my WEB-INF/lib file;
  2. Right-click on your project in 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. (as the figure below)

right click on your project in project explorer tab, and build path --> configure build path, -->external jars

add all the jars which you want.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!