HttpServletResponse.setCharacterEncoding() is not a static method. You need to call it on an instance. Something like: (assuming your instance is called resp
)
resp.setCharacterEncoding("UTF-8");
Alternatively, you could set character encoding in the Content-type
header like this:
resp.setContentType("text/html; charset=UTF-8")
EDIT: Ok, by your comments, I see you are already doing this. I took the wording of the question literally. Anyway, the problem is most likely that you are using javac
with dependency tracking turned on. It's a flag you can pass on the command line (or an attribute to the <javac>
ant task). Turn off dependency tracking. It's not supported by Sun's compiler.