Error compiling Java file with special characters in class name

后端 未结 2 742
生来不讨喜
生来不讨喜 2021-01-18 04:28

I am encountering an issue compiling a source file with a special character in the class name. The class file compiles fine in the Eclipse IDE, but not from javac. I belie

相关标签:
2条回答
  • 2021-01-18 04:30

    One solution is to list the file name of each compilation unit in a separate file, say files, and pass @files as a command-line argument to javac. Otherwise, you will have to set the locale of your shell, so that it is using the correct character encoding.

    0 讨论(0)
  • 2021-01-18 04:53

    Have you tried using -encoding UTF8 or -encoding UTF16LE (Little Endian) or -encoding UTF16BE (big endian)? (The usage of LE or BE depends on the system you are using -- Windows is LE from what I remember.)

    0 讨论(0)
提交回复
热议问题