0

for jvm compatibility, we are compiling a program with the jdk 1.5 version and the UTF-8 encoding (Maven plugin). But recently we changed the jdk version to 1.7 and from that we get a lot of "error: unmappable character for encoding UTF-8"

while, we didn't have this kind of error when we compile it with the jdk 1.5 version.

Is there a way to compile this program without getting these errors with the jdk 1.7 ?

We have already tested the solutions suggested like the 'text file encoding' property in eclipse or the 'encoding' tag for maven-compiler-plugin but without success.

thanks

kkung
  • 715
  • 4
  • 10
  • 18
  • 1
    you need to ensure both: file encoding is 'utf-8' AND tell the compiler (via maven plugin) that 'utf-8' is the encoding. – diginoise Mar 14 '17 at 11:01
  • it would be helpful if you attach the file which does not compile. – Eugene Mar 14 '17 at 11:04
  • The $64 question is "What encoding was used to edit the source files?". Historically eclipse has defaulted to the platform encoding which is not usually UTF-8 (although recent MacOS releases changed to this from the old MacRoman). Just changing the `'text file encoding' property in eclipse` will not fix the problem. You need to open and save each source file with the new encoding. Did you do that? – Steve C Mar 14 '17 at 13:48
  • Please show your pom file... – khmarbaise Mar 14 '17 at 15:34
  • Thanks everyone, now I know why I'm getting this error and how to solve it – kkung Mar 15 '17 at 09:16

0 Answers0