[英]Error occurs when I build the code with IntelliJ
I compile the project successfully in Eclipse without any error. 我在Eclipse中成功编译了项目,没有任何错误。
But when I tried to compile it in IntelliJ, the following error shows: 但是,当我尝试在IntelliJ中进行编译时,显示以下错误:
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. 我双击了错误消息,它位于一个Java类的第一行(即程序包定义行)中,并且该类中没有编译错误。
I tried to fix this by specifying the JDK, but it didn't work. 我试图通过指定JDK来解决此问题,但是它没有用。
Anyone knows what's happening here? 有人知道这里发生了什么吗?
Thanks RC. 谢谢RC。 I saved my file with UTF-8 in Sublime, then it works.
我用UTF-8将文件保存在Sublime中,然后它可以工作了。
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. 这就是我所做的:使用Sublime打开文件,
File->Save with Encoding
打开File->Save with Encoding
,将出现UTF-8 with DOM
UTF-8
和UTF-8 with DOM
,选择第一个,然后在IntelliJ中成功编译。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.