21

I'm having a problem using Netbeans 8.2 on my High Sierra Macbook Air. When it opens it does a few startup things that seem to proceed normally, then it pauses for a minute or so, then it says "unpacking index for central repository." And that's where it gets stuck. It never completes that process, even after a few hours of sitting.

Here are some things that may or may not matter, but in case they're important:

  1. At the bottom of Netbeans, to the right of where the updating index message displays, there's a red word bubble with the number 1. The word bubble is there even before unpacking starts. When I click on it, it bring up a notification, but all the notification says is "left button."

  2. I originally downloaded Netbeans a year or two ago for a Java class I was taking. At the time we were using Apache Tomcat for the server. I haven't tried to do anything with Apache recently.

  3. I downloaded Glassfish about 4 months ago. Can't remember whether I was installing a new JDK or not. I had not used Netbeans since the first Java class, but I was taking a new Java class that had me update things. Don't know if I tried connecting to the Glassfish server (is that right?) or not. I didn't use Netbeans after that, though, because I was able to do my assignments on another computer that had Netbeans installed. I think Netbeans had worked at that point, though. I recall being able to bring up some code. Now, however, when I try to open a project, nothing happens.

Kalle Richter
  • 8,008
  • 26
  • 77
  • 177
apex2022
  • 777
  • 2
  • 8
  • 28
  • 4
    This is a known bug, and has been for several years. See [Bug 239915 - Unpacking index is extremely slow](https://netbeans.org/bugzilla/show_bug.cgi?id=239915) for lots of details. Note that your problem is not necessarily due to NetBeans. For example, it could be due to lack of machine resources, network issues, or problems accessing Maven's repository. – skomisa Jun 20 '18 at 06:31
  • 6
    Also, you can disable indexing: **Tools > Options > Java > Maven > Index**, then check **Completely disable indexing** and click **OK**. However, doing that comes with a warning: _"NOT recommended, many features will be limited as a result"_. – skomisa Jun 20 '18 at 06:32
  • 1
    Also, there's a plugin named [Maven Remote Search](http://plugins.netbeans.org/plugin/68415/maven-remote-search) that you can use if you disable indexing. – skomisa Jun 20 '18 at 16:33

1 Answers1

10

I recently ran into this problem on CentOS. The root of the problem was that I was running out of disk space on my main drive (default tmp dir location).

To fix, I modified the netbeans/etc/netbeans.conf to specify a new tmp dir location in the netbeans_default_options setting, adding:

-J-Djava.io.tmpdir=/my/new/tmpdir

When opening a Maven POM for the first time, NetBeans will pull a file from Maven Central and index it, using the tmp dir. On my machine, this indexing operation used almost 6GB of space, which was larger than I had available at the default java.io.tmpdir location. Specifying a new location on a larger disk resolved the problem.

The error message I received from NetBeans was misleading, because it claimed I did not have enough space in my ~/.cache/netbeans dir to perform the cacheing. Changing the netbeans_default_cachedir in netbeans.conf did not resolve the issue. I had to manually watch for files being written to disk to find the problem and deduce it was the tmp dir running out of space, not the cache dir.

Kalle Richter
  • 8,008
  • 26
  • 77
  • 177
KevinB
  • 1,102
  • 2
  • 8
  • 19
  • Thanks, for those using UBUNTU and SNAP netbeans.conf will appear as read only. Take a look at kim Hersin answer on how to configure netbeans when installed as snap package. https://stackoverflow.com/questions/58825429/how-to-configure-netbeans-when-installed-as-snap-package – Jesus R Marval P Jun 18 '20 at 22:07
  • 3
    So much work just for a hello world! NetBeans have very intrusive views on how compilation should be. –  May 07 '21 at 12:33