0

I compile the project successfully in Eclipse without any error.

But when I tried to compile it in IntelliJ, the following error shows:

enter image description here

I double-clicked the error message, it located into the first line of one Java class, which is the package definition line, and there's no compilation error in this class.

I tried to fix this by specifying the JDK, but it didn't work.

Anyone knows what's happening here?

Sky
  • 7,343
  • 8
  • 31
  • 42
  • 1
    sounds like a BOM issue in the java source file. see http://stackoverflow.com/questions/9100728/remove-multiple-boms-from-a-file for solutions to remove it –  Dec 10 '15 at 06:05
  • Thanks a lot. I saved my file with UTF-8 encoding without DOM in Sublime, then it works. :) – Sky Dec 10 '15 at 08:08

1 Answers1

1

Thanks RC. I saved my file with UTF-8 in Sublime, then it works.

This is what I did: Open the file with Sublime, File->Save with Encoding, there will be UTF-8 and UTF-8 with DOM, select the first one, then it compiled successfully in IntelliJ.

Sky
  • 7,343
  • 8
  • 31
  • 42