I am utilizing a the normalize function to obtain the absolute path from the String,


However when I personally use just normalize(String) I recieve :

The technique normalize(String) is undefined for that type MyClass

I attempted : import org.apache.commons.io.FilenameUtils;

I downloaded the library from Apache website, and linked it to my project however i obtain the same error.

I'd rather not write each time the entire line to call the function.

Can there be any solution with this ?


Either import the course:

import org.apache.commons.io.FilenameUtils;


or import the technique:

import static org.apache.commons.io.FilenameUtils.normalize;


And when you're using Eclipse, just press Control-change-M to import what your cursor reaches. Also autocompleting classnames should add imports.

keep your import as import org.apache.commons.io.FilenameUtils; and invoke the technique as FilenameUtils.normalize(string).

or alter the import to import static org.apache.commons.io.FilenameUtils.normalize; and then leave the technique invocation because it is (normalize(string)).

Appears like a static method. You have to keep your import there after which call: