javaeclipseapache-commons-codec

Eclipse claims Commons-Codec methods don't exist


I'm working on validating the signed_request parameter from the Facebook API, following these guidelines, but I'm running into issues calling some of the methods of the Base64 class from Commons Codec. I added the commons-codec 1.6 library to my project (picture of my referenced libraries), but Eclipse is showing

Constructor with red underline

and saying

Error message (Constructor Base64(boolean) is undefined)

which is odd, since this says otherwise.

I verified the md5 of the download, so that's not the issue.

Any bright ideas?


Solution

  • I suspect that you have another version of commons-codes classes in your classpath, before the commons-codec jar you installed.

    Make sure the "Link with Editor" icon button at the top of the package explorer is pressed, and then ctrl-click on the Base64 type in your editor. Then check if the selected class file in the package editor is the class inside the commons-codec-1.6.jar, or if it's a class in another jar.