Is there a way to stop NetBeans scanning projects?

前端 未结 21 1884
孤街浪徒
孤街浪徒 2020-12-07 18:34

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

相关标签:
21条回答
  • 2020-12-07 19:05

    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.

    0 讨论(0)
  • 2020-12-07 19:06

    In addition to creating smaller Projects for the folders you really work on and then a Project Group to group them (Mateng), you can try excluding folders that you will never work on such as images folders and so on. To ignore those folders, go to:

    File > Project Properties > Ignored Folders > Add Folder...

    From NetBeans Help:

    The Ignored Files property is the opposite of the Include Path. These are files inside the PHP project that you want the IDE to ignore for FTP upload, scanning, etc.

    0 讨论(0)
  • 2020-12-07 19:07

    In my case, with jdk 1.8, there is a big issue when there are multiple static imports (see the example). It seems that there is a problem with javac. The compiler is very slow when checking such a .java file and NetBeans scanning is very very slow. It seems that the compilation and scanning time is increasing very fast with each repeated static import. So, if that is your case, just remove repeated imports

    package ru.cntp.demo;
    
    import java.math.BigDecimal;
    
    import static java.util.Arrays.asList;
    import java.util.List;
    import java.util.Map;
    import static java.util.stream.Collectors.groupingBy;
    import static java.util.stream.Collectors.groupingBy;
    import static java.util.stream.Collectors.groupingBy;
    import static java.util.stream.Collectors.groupingBy;
    import static java.util.stream.Collectors.groupingBy;
    import static java.util.stream.Collectors.groupingBy;
    import static java.util.stream.Collectors.groupingBy;
    import static java.util.stream.Collectors.groupingBy;
    import static java.util.stream.Collectors.groupingBy;
    import static java.util.stream.Collectors.groupingBy;
    
    /**
     *
     * @author sergiu
     */
    public class EmployeeRepository {
    
        public Map<Department, Map<String, Map<String, Map<String, Map<BigDecimal, List<Employee>>>>>> getEmployeesByDepartment() {
    
            Country germany = new Country("Germany");
    
            Department germanyDeptOne = new Department("Dept One", germany);
    
            Employee emp1 = new Employee("Surame", "Name", "Patronymic", BigDecimal.TEN, germanyDeptOne);
    
    
            return asList(emp1).stream()
                    .collect(groupingBy(Employee::getDepartment,
                            groupingBy(Employee::getSurname,
                                    groupingBy(Employee::getName,
                                            groupingBy(Employee::getPatronymic,
                                                    groupingBy(Employee::getSalary))))));
        }
    
    }
    
    0 讨论(0)
  • 2020-12-07 19:07

    Plugin download - Direct Download

    http://wiki.netbeans.org/wiki/images/c/cc/Org-netbeans-modules-scanondemand.nbm

    0 讨论(0)
  • 2020-12-07 19:08

    I don't know whether you can disable the project scanning or not. Even if you can, I doubt it will ever work properly again. There are a few tips which I have done and it speed up my Netbeans.

    1. Close Tasks window. This prevents Netbeans to scan for TODO in the comments.
    2. Exclude virus scanning for *.jar, java folders and netbeans folder. This speeds up my netbeans A LOT.

    Netbeans consumes a lot of memory so adding memory also increases its performance (OS does not need to swap between memory and page file when memory is running low) (but this is probably not an option for you). Also, Netbeans consists of hundreds of files which needs to be loaded at start up so the bottom neck is the speed of your hard disk.

    0 讨论(0)
  • 2020-12-07 19:10

    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

    0 讨论(0)
提交回复
热议问题