简体   繁体   English

使用IntelliJ构建代码时发生错误

[英]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-8UTF-8 with DOM ,选择第一个,然后在IntelliJ中成功编译。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试在IntelliJ上构建Gradle项目时出现错误代码B0 - Error code B0 when trying to build gradle project on IntelliJ 尝试在 IntelliJ 中启动 Java GUI 时发生错误 - Error occurs when trying to start Java GUI in IntelliJ .jar 文件在 IntelliJ 中工作,但是当 .jar 在 IntelliJ 之外运行时发生 JVM 错误 - .jar file works in IntelliJ but JVM error occurs when .jar is run outside of IntelliJ 导入build.gradle时出现Intellij错误 - Intellij error when importing build.gradle 更改minSDKVersion时发生NetworkOnMainThreadException错误 - NetworkOnMainThreadException error occurs when I change the minSDKVersion 构建APK时Android Studio中出现错误消息 - Error message occurs in Android studio when build APK Intellij手动添加jar会出现编译错误 - Compilation error occurs if jars are added manually in Intellij 错误:找不到或加载主类。 编译代码时会发生这种情况 - Error: Could not find or load main class . this occurs when compiling code NotReadableException: JSON 解析错误: Unexpected character (&#39;&lt;&#39; (code 60)) 仅在我使用 https url 时发生,对于相同的 url http 工作正常 - NotReadableException: JSON parse error: Unexpected character ('<' (code 60)) occurs only when I use https url, working fine for same url http 在 intellij 中使用 lombok 编译错误 - 仅在运行构建时 - Compile error with lombok in intellij - only when running build
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM