0

I got a lot of compile errors (500+) when converting my Android project into AspectJ project. Most of the errors are like "xxx cannot be resolved to a type"

As this page suggests, this might be an encoding issue: Compiling errors occur while convert a project to AspectJ project with AspectJ eclipse 3.4 plugin, ajdt2.0.1.... But I am not able to figure out how to set this ajc option in Eclipse.

I am using ADT.

Could anyone help me out? Just let me know if you need other information.

Thanks.

Community
  • 1
  • 1
Jiechao Wang
  • 922
  • 1
  • 15
  • 32

2 Answers2

0

Please, try to execute this on command line: ajc -encoding UTF-8

If ajc was not recognized as a command, please add it to the Path.

I found these links, they could be helpful:
http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg07331.html http://osdir.com/ml/java.aop.aspectj.general/2007-01/msg00034.html
How to change the defaults system java encode form in windows?

Please, let me know if you resolved your issue.

Carlos

Community
  • 1
  • 1
carlosmaciel
  • 801
  • 1
  • 6
  • 17
  • Thanks Carlos. I've already installed AJDT in Eclipse, but in order for me to execute ajc, I think I need to install AspectJ compiler as well, is it correct? After I install AspectJ compiler, I enter "ajc -encoding UTF-8", but encounter this error "[error] no sources specified". How should I resolve this? What kind of source it is asking? Thx!! – Jiechao Wang Jan 09 '14 at 17:42
  • Sorry for not answer it on time. I see you found the exact cause of the problem, I'm glad I may helped a bit. :D – carlosmaciel Jan 27 '14 at 16:46
0

I think I solved my problem.

Because I am on Mac, ADT is using some weird encoding for text files. I just need to tell ADT to use UTF-8, which is also used by AspectJ compiler.

These compile errors were caused by the fact that ADT and AspectJ compiler were using different encodings.

Jiechao Wang
  • 922
  • 1
  • 15
  • 32