Since a few days, navigating the file system with Netbeans is VERY slow (more than two minutes to access a file, and if you have to navigate a file system, it is true every time. I have exactly the same problem after clearing the cache, and with Netbeans 8.2 and Netbeans 12 (Netbeans 8 with Java 8, and Netbeans 12 with Java 17 in my tests).
Strangely I don’t have the same problem with regular Java file choosers which I use in my projects. For example, if I click on “Open Project”, the IDE is frozen for sometimes 2 or 3 minutes before I can see the file navigator.
When I am looking in the task manager while trying to open a project for example, it appear that Network usage is very low (1% to 0%), CPU also very low (less than 2%)
I am talking about Netbeans itself, for example if I want to open an existing project, or adding a jar file to the list of Jar libraries for an existing project
The standard Swing JFileChooser works correctly. With this example code the navigation is immediate (as expected):
JFileChooser chooser = new JFileChooser(); chooser.setDialogType(JFileChooser.OPEN_DIALOG); chooser.setDialogTitle("Test FileChooser"); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); int ret = chooser.showOpenDialog(null); if (ret == JFileChooser.APPROVE_OPTION{ System.out.println(chooser.getSelectedFile().getAbsolutePath()); }
I am on Windows, on my workplace network (I am working on local files on my PC, but there are two remote drives which are accessible on the network). I only have problems with Netbeans, other apps have no problem with the file system.
My problem is with Netbeans itself navigating the file system (for example opening an existing project, or adding a jar file as a library for a project)
This looks to behave exactly as this bug: https://bz.apache.org/netbeans/show_bug.cgi?id=42079, except that it does not happen with the Swing JFileChooser
as shown above.
Is it a known problem, and if it is, is there a mean to fix it? I was thinking for example about a setting on the command line used to start Netbeans.
Advertisement
Answer
There is a bug in netbeans with links from the desktop, that behaves like you described. Try to remove all links from the desktop and default location for the open file dialog.