Eclipse claims Commons-Codec methods don't exist
-
12-06-2021 - |
سؤال
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 (), but Eclipse is showing
and saying
which is odd, since this says otherwise.
I verified the md5 of the download, so that's not the issue.
Any bright ideas?
المحلول
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.
نصائح أخرى
I faced the same issue. It got resolved after I moved the codec jar in the build order. But I couldn't able to build the GWT project. It shows the following error
String key = new String(Base64.decodeBase64("xxxx"));
error: method decodeBase64 in class Base64 cannot be applied to given types; "actual argument String cannot be converted to byte[] by method invocation conversion".
The JRE still reads the codec package from GWT package. How to resolve this?