简体   繁体   English

IntelliJ奇怪的行为

[英]IntelliJ strange behavior

I've installed 30 day trial of IntelliJ 15.0.2 and cloned my project using git (I've created this project in community version). 我已经安装了IntelliJ 15.0.2的30天试用版,并使用git克隆了我的项目(我已经在社区版本中创建了这个项目)。 Project compiles (maven), runs, works. 项目编译(Maven),运行,运行。 But new IntelliJ does not underline my errors, misspellings etc. When I wanted to commit, IntelliJ shows big number of errors, mostly on imports, as it can't resolve them. 但是新的IntelliJ并没有强调我的错误,拼写错误等。当我想要提交时,IntelliJ会显示大量错误,主要是在导入上,因为它无法解决它们。 All dependencies are inside pom.xml. 所有依赖项都在pom.xml内部。 Once again, there were no errors in community version of IntelliJ. 再次,IntelliJ社区版本没有任何错误。 Ultimate version builds project just fine, but doesn't underline any errors and shows almost every import as unsolvable. 最终版本可以很好地构建项目,但不会强调任何错误,并且几乎将每个导入都显示为无法解决。 What could go wrong? 可能出什么问题了? How to fix it? 如何解决?

Go to Build -> Make Project . 转到Build -> Make Project After that errors should be visible in the project tree and in the specific project files. 之后,错误应在项目树和特定项目文件中可见。

您可能需要标记源目录,方法是在项目选项卡上单击鼠标右键,然后选择将目录标记为->源目录

Check that you have a correct project sdk set in modules configuration. 检查模块配置中是否设置了正确的项目SDK。 If IJ doesn't found any classes, jdk classes included, probably there is no sdk set. 如果IJ未找到任何类,包括jdk类,则可能没有sdk设置。

You can also try to invalidate caches (in File menu) and rebuild project 您也可以尝试使缓存无效(在“文件”菜单中)并重建项目

I have faced with strange behaviour of Intelij Idea after update (syntax highlight stopped working). 更新后,我遇到了Intelij Idea的奇怪行为(语法高亮停止工作了)。 If you want to understand what is going on with yor Idea and can not quickly find an answer in internet, just go to Log files (for Mac OS the path is 如果您想了解yor Idea发生了什么,并且无法在Internet上快速找到答案,只需转到“日志文件”(对于Mac OS,路径为

~/Library/Logs/IntelliJIdea< your version>

List all files in that directory 列出该目录中的所有文件

ls -la

in terminal and find the latest one. 在终端中找到最新的。 Usually it should be idea.log (without numbers, logs with numbers identify logs for previous days). 通常应为idea.log(无数字,带数字的日志标识前几天的日志)。 View that log. 查看该日志。 If that log contains a lot of ERRORS, try to find the reason (you can just type 如果该日志包含很多错误,请尝试查找原因(您可以键入

grep "ERROR" idea.log 

in terminal to find all lines that contain errors). 在终端中查找包含错误的所有行)。 Usually log files shouldn't contain errors, just info and warnings. 通常,日志文件不应包含错误,而应仅包含信息和警告。

In my case syntax highlight stopped working. 在我的情况下,语法高亮停止了工作。 The log looked like 日志看起来像 在此处输入图片说明

You can see here that error is in plugins that called like haxe. 您可以在此处看到错误发生在名为haxe之类的插件中。

I found that plugin in my idea, uninstalled it and idea started working properly. 我在我的想法中找到了该插件,将其卸载并开始正常工作。 I investigated the log after and what I have seen there: 我调查了之后的日志以及在那看到的内容: 在此处输入图片说明

You can see just INFO in new rows. 您可以在新行中仅看到INFO。

Investigating a log can be really useful if you can not find the rootcase of your problem quickly in the internet. 如果您无法在Internet上快速找到问题的根源,那么调查日志非常有用。 I hope it can help you even if it can be quite tricky. 我希望它可以帮助您,即使它可能非常棘手。

Good luck! 祝好运!

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM