It is unnecessary to convert it to CFML code. There is in fact every advantage in running the Java code directly.
Save the above content as HtmlEscape.java. Compile it to HtmlEscape.class, using the same Java version as that of your Coldfusion installation. Create the directory /net/htmlescape/ in {CF_WEBROOT}\WEB-INF\classes and copy the class file into it. Restart Coldfusion.
You can now use the HtmlEscape service. For example, start with the following test code:
<cfset testObj = createobject("java","net.htmlescape.HtmlEscape")>
<cfdump var="#testObj#">