eclipse 让 IntelliJ IDEA 刷新项目并检测更改的文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4599180/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
have IntelliJ IDEA refresh the project and detect changed files
提问by Garret Wilson
I'm using Eclipse for development because of all the things IntelliJ can't do (e.g. highlight all instances of a variable) and because IntelliJ is dog slow over a remote connection. But because I still don't have Maven integrated completely into Eclipse, I have to switch back to IntelliJ to compile and run my project using Tomcat.
我使用 Eclipse 进行开发,因为 IntelliJ 不能做的所有事情(例如突出显示变量的所有实例),并且因为 IntelliJ 在远程连接上速度很慢。但是因为我还没有将 Maven 完全集成到 Eclipse 中,所以我必须切换回 IntelliJ 以使用 Tomcat 编译和运行我的项目。
How can I tell IntelliJ to detect all files that have changed on the file system and recompile them? (I don't want to manually open each changed file to get IntelliJ to detect the change.) In Eclipse I would just Refresh the project tree [1]...
如何告诉 IntelliJ 检测文件系统上已更改的所有文件并重新编译它们?(我不想手动打开每个更改的文件来让 IntelliJ 检测更改。)在 Eclipse 中,我只会刷新项目树 [ 1]...
Footnotes:
脚注:
- Eclipse has a feature (named "Refresh Using native hooks or polling") which you can enable to automatically detect changes and synchronise the perspective when any underlying changes are detected in the filesystem (see images below). This is quite handy and eliminates the need to manually refresh the project when using build tools - where files/directories get created in the project directory structure.
- Eclipse 有一个功能(名为“使用本机钩子或轮询刷新”),当在文件系统中检测到任何底层更改时,您可以启用该功能自动检测更改并同步透视图(见下图)。这非常方便,并且无需在使用构建工具时手动刷新项目 - 在项目目录结构中创建文件/目录。
Is there anything similar for Intellij (explicit setting or otherwise) that eliminates having to click a button to synchronize the view with filesystem changes?
Intellij(显式设置或其他)是否有类似的东西,无需单击按钮即可将视图与文件系统更改同步?
回答by krakover
You can use the "synchronize" button (two yellow arrows) or in short Ctrl+Alt+Y
您可以使用“同步”按钮(两个黄色箭头)或简称Ctrl+ Alt+Y
回答by m.milicevic
Intellij can highlight variable instances, you just need to enable it . Further, if you invoke compile project, Intellij will just compile changed files (and hotswap when possible, if you are in debug mode & deploying to e.g. tomcat)
Intellij 可以突出显示变量实例,您只需要启用它。此外,如果您调用编译项目,Intellij 将只编译更改的文件(如果您处于调试模式并部署到例如 tomcat,则在可能的情况下进行热交换)
回答by benignfoppery
Right click on your Project in the left pane and click on "Synchronize"
在左窗格中右键单击您的项目,然后单击“同步”
You can see the status in the round circling icon at the bottom left of the IDE
您可以在 IDE 左下角的圆形圆圈图标中看到状态
回答by vadiraj jahagirdar
Click File>Synchronize (or) shortcut ctrl+Alt+Y
单击文件>同步(或)快捷键 ctrl+Alt+Y
回答by Testilla
回答by tijis
I know this question was posted a few years ago, but maybe this info will help someone in the future. I was actually looking into a similar issue, and doing the following worked for me:
我知道这个问题是几年前发布的,但也许这些信息将来会对某人有所帮助。我实际上正在研究类似的问题,并执行以下操作对我有用:
Go to Settings > Build, Execution, Deployment > Compiler and make sure "Make project automatically" is checked.
转到设置 > 构建、执行、部署 > 编译器并确保选中“自动生成项目”。