h3a
h3a

Reputation:

ant javac problem

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

and there is no problem with the class xx.java

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"/>                                    
    </copy>

Upvotes: 0

Views: 6434

Answers (3)

h3a
h3a

Reputation:

I had to recreate the class and copy the code line by line ...

this is really a problem ...

Upvotes: 0

Andy White
Andy White

Reputation: 88475

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:

http://groups.google.com/group/comp.lang.java.programmer/browse_frm/thread/adb0500c61451317?pli=1

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

Upvotes: 4

dfa
dfa

Reputation: 116442

check carefully your file, probably there is an extra character

Upvotes: 0

Related Questions