jars added to WEB-INF/lib doesn't get recogniz

2019-02-26 04:03发布

I have added org.apache.commons.fileupload and org.apache.commons.io package into the WEB-INF/lib directory of my project based on google appengine. But when I try importing in the servlet files the compiler/IDE gives an error that this package doesn't exist. Why is that ?

The jar files added :

enter image description here

What can be the reason I am getting this error ? What should I do to solve this problem ?

3条回答
聊天终结者
2楼-- · 2019-02-26 04:34

If the IDE gives the problem then update the jars in IDE project class path :)

查看更多
干净又极端
3楼-- · 2019-02-26 04:47

You might also have to add them to your project's classpath.

for eclipse:

Right click the jar, select build path and add it to the build path, then try again.

for netbeans:

in the project properties window click libraries in the left panel. In the right panel add it to the compile classpath

查看更多
Melony?
4楼-- · 2019-02-26 04:48

General solution , whenever you get package does not exist then there are 2 things, 1- Its not at all present 2) its present but still the error is thrown. The solution to this is to just add the jar to the classpath [so that your app finds it during compilation,execution)

I would suggest you to try Maven . Maven is a nice way by which you can organize this in a systematic way.

查看更多
登录 后发表回答