Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

StringEscapeUtils can not be resolved

I have added the dependency in pom.xml

<dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.1</version>
        </dependency>

but when i update maven dependencies and import the EscapeStringUtils using

import org.apache.commons.lang3.StringEscapeUtils;

i get it red underlined and error which states :

The import org.apache.commons.lang3.StringEscapeUtils cannot be resolved

Jar file is there (downloaded) now how can i fix it, i have no idea. Kindly help me.

Thanks

like image 365
Shahzeb Khan Avatar asked Apr 10 '13 07:04

Shahzeb Khan


People also ask

What is StringEscapeUtils?

public class StringEscapeUtils extends Object. Escapes and unescapes String s for Java, Java Script, HTML and XML. #ThreadSafe# This code has been adapted from Apache Commons Lang 3.5.

Is Org Apache Commons Lang StringEscapeUtils deprecated?

@user3871754 No, it is deprecated in the org. apache. commons.

What does StringEscapeUtils escapeHtml do?

escapeHtml. Escapes the characters in a String using HTML entities and writes them to a Writer .


2 Answers

Thanks for all replies, i solved it by downloading manually the .jar file from the following link and overwrite the existing jar downloaded by maven. (i don't know why it started working after manual download, but after all, its working)

http://commons.apache.org/proper/commons-lang/download_lang.cgi

like image 159
Shahzeb Khan Avatar answered Oct 24 '22 12:10

Shahzeb Khan


If you sure that jar file includes StringEscapeUtils in the classpath you should clean the project.

like image 33
Ugur Artun Avatar answered Oct 24 '22 10:10

Ugur Artun