eclipse - "java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils" being thrown even though jar is in /lib -


i using eclipse indigo , have 2 dynamic web projects: project , project b.

project has project b required project on build path , has ticked on properties -> java build path -> order , export.

i have method in project a, calls method in project b has line:

 fileutils.writestringtofile(file, data); 

this line throws following exception:

java.lang.classnotfoundexception: org.apache.commons.io.fileutils     @ java.net.urlclassloader$1.run(unknown source)     @ java.net.urlclassloader$1.run(unknown source)     @ java.security.accesscontroller.doprivileged(native method)     @ java.net.urlclassloader.findclass(unknown source)     @ java.lang.classloader.loadclass(unknown source)     @ sun.misc.launcher$appclassloader.loadclass(unknown source)     @ java.lang.classloader.loadclass(unknown source)     @ my.package.projectb.class.createandwritetofile(fileutil.java:62)     @ my.package.projecta.class.savecurrentdialog(uiresponsestrategy.java:99)     ... 

project b has commons-io-2.4.jar in web-inf\lib , when project b run , calls method using methods commons io jar, no exception thrown.

project throws exception whether or not has commons-io-2.4.jar in it's own web-inf\lib folder.

i have checked , eclipse indeed deploying jar projects.

is there way fix problem?

edit: i'm using eclipse indigo, not juno.

edit 2: made new java project has main , line:

fileutil.createandwritetofile(new file("./test.txt"), "test-data");

as project b required project on build path. no exception thrown.

can call method project b in project a?

are both project folders open when try running this? i've had issue when using google maps api in eclipse while debugging android projects.


Comments