Is there a way to stop NetBeans scanning projects?

2020-02-02 06:29发布

I don't have much memory on my PC and a pretty weak processor. Although netbeans is by far my favorite IDE it is almost unbearable to use on my present computer because of the project scanning that starts automatically when I open the program.

Is there a way to prevent netbeans from scanning projects?

标签: java netbeans
21条回答
爱情/是我丢掉的垃圾
2楼-- · 2020-02-02 06:38

This below solved it for me. One project when opened would cause never ending background scanning... this would also mean the code completion etc could never work. My machine was devoting a huge amount of resources to this.

Someone here gave me the clue: right click the project, choose properties, then "Ignored Folders".

Essentially I used this to determine which (specific) folder was the cause of the scanning. I selected the first half, then the second half of the remaining etc a process of elimination... and out of hundreds of folders, I found a (php HMVC view folder that caused it) ... I needed to stop and kill the scanning, then re-start many times...

Here is the easiest way for various reasons:

In the "ignore folders" area, select all the folders and add them all (fairly individually) to the ignore list. Then shut down the ide, and restart. When all background scanning is absent (it starts and runs for a few seconds/minutes normally), begin removing one or a few of the folders. After each removal, close the properties window..... the IDE will quickly scan those folders you removed and will IF no issue with those stop scanning. IF you have just removed the culprit folder, then the scanning will never end...

查看更多
乱世女痞
3楼-- · 2020-02-02 06:41

If your project is a Maven structured project you can use a simple trick to make your and NetBeans life a lot easier.

I have my projects inside of c:\dev on my machine. That's the place where Netbeans is working with. If I build in this folder then NetBean's background process get very busy.

But if I copy the c:\dev\trunk project for example to c:\deploy\trunk before I start mvn clean install inside of c:\build\trunk then NetBeans does not need to scan the changes that happen in this folder. It does not know about it.

I use on a windows machine:

robocopy c:\dev\trunk c:\deploy\trunk /MIR /NFL /NS /NC /NDL /XD ".svn"

It is a windows native command. No additional installation necessary.

It helped me a lot decrease build time and also to avoid never ending scans on Netbeans.

If you use tools like JRebel you can still work like this when you update the changed classes to your c:\deploy\trunk folder. You can use the same command.

It is of course a bit of a workaround, but it helps a lot. :-)

查看更多
三岁会撩人
4楼-- · 2020-02-02 06:41

My project became Very Big over time

In the below 2 cases, it is too slow:

  1. While opening NetBeans project - this is too slow
  2. Automatic scanning of NetBeans project

What did not work for me are:
1. Doing Window > Reset Windows only solves temporarily
2. Sometimes felt my GIT repository integration with Netbeans is the main issue, but there was no clear proof for it

Solution for 1):

Run below commands:

WARNING Below commands have automated delete commands

Close the Netbeans IDE
cd %USERPROFILE%\AppData\Local\NetBeans\Cache\                  && del /s /q .\  && rmdir /s /q .\
cd %USERPROFILE%\AppData\Roaming\NetBeans\8.2\var\filehistory\  && del /s /q .\  && rmdir /s /q .\
cd %USERPROFILE%\AppData\Roaming\NetBeans\8.2\var\log           && del /s /q .\  && rmdir /s /q .\

And, the problem 1) is now rarely comes up, other times Netbeans loads almost immediately.

Solution for 2):

root
....f1
........f11
........f12
....f2
........f21
........f22

root is a folder and also it's the main NetBeans project
f1, f2 are just folders
f11, f12, f21, f22 are sub-folders that are also NetBeans projects too

Earlier, I was opening root Netbeans project, and the system became too slow due to netbeans scanning the whole project from root, and antivirus was working very hard to cooperate with Netbeans project scanning, result everything in system gets slow.

Now, the solution is open sub-projects like f11, f12, f21, f22, etc. you can open many small sub-project, the Netbeans project scanning issue is fully gone.

查看更多
ら.Afraid
5楼-- · 2020-02-02 06:42

Try this: http://wiki.netbeans.org/ScanOnDemand

Warning: Currently, this plugin only works with development builds. DO NOT use these instructions with an official release...

As soon as you start the NetBeans IDE, the system does so called "up-to-date check" to verify that no files have been changed. If this seems to take too long in your case, and prevents you from performing your work, you may be interested in ScanOnDemand.

The most basic functionality of ScanOnDemand is to disable (potentially long) up-to-date check after start of the IDE. This is done under the expectation that most of the operations with your sources are done from inside the IDE and thus when the IDE is shut down, no important change can happen and thus there is no need to rescan anything. Indeed, this may not be fully accurate, but the fix is easy, in the rare situation where your significantly updated your sources using other tools, just trigger the refresh manually.

Once again the NetBeans IDE gives you more control. You stay in charge, deciding what to do and when...

To help in this area, we decided to create an experimental module, which is available on Update Center (as of release 6.7). The module omits automatic updates in certain situations (e.g. up-to-date check after startup and after switch to main window). The responsibility to invoke rescan and so make the data up-to-date is on the user - via explicit refresh action...

查看更多
霸刀☆藐视天下
6楼-- · 2020-02-02 06:42

i know this is an old question but this may help others... To enable or disable background scanning you can find the option under menu Tools -> Options -> Miscellaneus -> Files

https://blogs.oracle.com/netbeansphp/entry/enable_auto_scanning_of_sources

查看更多
时光不老,我们不散
7楼-- · 2020-02-02 06:44

Hey George I don't know if this is much of an answer but I right-click and choose 'close' on the projects that I don't need open. There's no point in having all your past projects listed there. Just have the one that you are developing open. You can always reopen the other projects from the menu. Once all the projects you aren't using are closed they won't be scanned each time you start Netbeans.

查看更多
登录 后发表回答