Ant javac problem


compiling with javac ant task giving me errors that doesn't exists..
[javac] D:\mySrc\ illegal character: \65279
[javac] package com.x.y;

and there is no problem with the class

here is my compile target:

<javac srcdir="${src}/src" destdir="${bin}" encoding = "utf-8" classpathref="classpath" debug="true" debuglevel="lines,vars,source" deprecation="off" />
     <copy todir="${bin}" overwrite="no">
    <fileset dir="${src}/src" excludes="**/*.java"/>                                    

Best Solution

The issue is probably with the Byte Order Mark (the thing that looks like: ""). These three special characters at the beginning of the file indicate that the file is in UTF-8 encoding. I've seen a few cases where the Java tools don't deal with this very well. See if you can delete this from your file, or setup your editor to not insert this BOM in the file.

Here's a good thread on this topic:

Try searching google for "javac illegal character \65279". This should give you some additional resources.