如何清除 NetBeans 中的缓存

发布于 2024-12-23 17:46:06 字数 104 浏览 2 评论 0原文

我在 NetBeans 中创建了一个项目,我想清除 NetBeans 缓存。

我在 Windows 7 计算机上运行 NetBeans 7.0.1。

我该怎么做?

I created a project in NetBeans, and I would like to clear the NetBeans cache.

I'm running NetBeans 7.0.1 on a Windows 7 machine.

How do I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(13

雨轻弹 2024-12-30 17:46:06

在删除缓存之前关闭 NetBeans。

NetBeans 7.2+、Windows 7

缓存位于 C:\Users\<用户名>\AppData\Local\NetBeans\Cache\

使用 %USERPROFILE% Windows 变量清除缓存:

del /s /q %USERPROFILE%\AppData\Local\NetBeans\Cache\

如果已设置,您还可以使用环境变量 %LOCALAPPDATA%

del /s /q %LOCALAPPDATA%\NetBeans\Cache\

NetBeans 7.2+,Linux

缓存位于: ~/.cache/netbeans/${netbeans_version}/index/

Mac OS X

缓存位于: ~/Library/Caches/NetBeans/${netbeans_version}/

另请参见 http://wiki .netbeans.org/FaqWhatIsUserdir

帮助菜单

在 Windows 上,选择帮助 » 关于菜单将显示一个包含以下文本的对话框:

Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Java: 1.7.0_80; Java HotSpot(TM) 64-Bit Server VM 24.80-b11
Runtime: Java(TM) SE Runtime Environment 1.7.0_80-b15
System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb)
User directory: C:\Users\Username\AppData\Roaming\NetBeans\8.0.2
Cache directory: C:\Users\Username\AppData\Local\NetBeans\Cache\8.0.2

无论操作系统如何,“关于”对话框都将包含缓存目录的正确路径。

Close NetBeans before deleting the cache.

NetBeans 7.2+, Windows 7

Cache is located in C:\Users\<username>\AppData\Local\NetBeans\Cache\.

Clear the cache using the %USERPROFILE% Windows variable:

del /s /q %USERPROFILE%\AppData\Local\NetBeans\Cache\

If it is set, you can also use the environment variable %LOCALAPPDATA%:

del /s /q %LOCALAPPDATA%\NetBeans\Cache\

NetBeans 7.2+, Linux

Cache is at: ~/.cache/netbeans/${netbeans_version}/index/

Mac OS X

Cache is at: ~/Library/Caches/NetBeans/${netbeans_version}/

See also http://wiki.netbeans.org/FaqWhatIsUserdir.

Help Menu

On Windows, selecting the Help » About menu will display a dialog that contains the following text:

Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Java: 1.7.0_80; Java HotSpot(TM) 64-Bit Server VM 24.80-b11
Runtime: Java(TM) SE Runtime Environment 1.7.0_80-b15
System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb)
User directory: C:\Users\Username\AppData\Roaming\NetBeans\8.0.2
Cache directory: C:\Users\Username\AppData\Local\NetBeans\Cache\8.0.2

Regardless of operating system, the About dialog will contain the correct path to the cache directory.

以往的大感动 2024-12-30 17:46:06

缓存目录的路径列在“关于”窗口(菜单“帮助/关于”)中。关闭 NetBeans,然后删除(或重命名)该目录。 NetBeans 将在启动时重建其缓存。

The path of the cache directory is listed in the About window (menu Help/About). Close NetBeans, then delete (or rename) the directory. NetBeans will rebuild its cache when it starts up.

羁〃客ぐ 2024-12-30 17:46:06

在 7.2 之前,缓存位于 C:\Users\username\.netbeans\7.0\var\cache。删除此目录应该会清除缓存。

Before 7.2, the cache is at C:\Users\username\.netbeans\7.0\var\cache. Deleting this directory should clear the cache for you.

情释 2024-12-30 17:46:06

在装有 NetBeans 8.1 的 Mac 上,

  1. NetBeans关于
  2. 关于屏幕中查找用户目录路径
  3. rm -fr 8.1 在您的情况下,版本可能会有所不同;删除正确的版本文件夹。
  4. 重新打开 NetBeans

On a Mac with NetBeans 8.1,

  1. NetBeansAbout
  2. Find User Directory path in the About screen
  3. rm -fr 8.1 In your case the version could be different; remove the right version folder.
  4. Reopen NetBeans
╰ゝ天使的微笑 2024-12-30 17:46:06

我只想补充一点,我曾尝试解决由于缓存中缺少库而导致的引用问题,并且删除缓存不足以解决问题。

我关闭了 NetBeans (7.2.1),删除了缓存,然后重新打开 NetBeans,它重新生成了缓存,但库仍然丢失(通过查看 .../Cache/7.2.1/index/archives.properties 进行检查) 。

为了解决这个问题,我必须先关闭打开的项目,然后再关闭 NetBeans 并删除缓存。

I'll just add that I have tried to resolve reference problems caused by a missing library in the cache, and deleting the cache was not enough to solve the problem.

I closed NetBeans (7.2.1), deleted the cache, then reopened NetBeans, and it regenerated the cache, but the library was still missing (checked by looking in .../Cache/7.2.1/index/archives.properties).

To resolve the problem I had to close my open projects before closing NetBeans and deleting the cache.

秋意浓 2024-12-30 17:46:06

对于 Linux 中的 Netbeans 7.4 及更高版本,缓存为 $HOME/.cache/netbeans/7.4

For Netbeans 7.4 and above in Linux, the cache is $HOME/.cache/netbeans/7.4.

冬天旳寂寞 2024-12-30 17:46:06

在 Window 7 中,缓存位于 C:/Users/USERNAME/AppData/Local/NetBeans/Cache

In Window 7 the cache is located at C:/Users/USERNAME/AppData/Local/NetBeans/Cache

兔小萌 2024-12-30 17:46:06

NetBeans cachedir 是一个由文件组成的目录,这些文件可能会变大、可能会频繁更改、并且可以随时删除和重新创建。例如,Java 类路径扫描的结果驻留在缓存目录中。

NetBeans 7.1 及更早版本
默认情况下,userdir 位于存储在用户主目录中名为 .netbeans 的(隐藏)目录中。主目录在类 Unix 系统上为 ${HOME},在 Windows 上为 %USERPROFILE%(通常设置为 C:\Documents and Settings\)。 cachedir 可以在 userdir 的 var/cache 子文件夹中找到。
顾名思义,每个用户的 userdir 都是唯一的。对于安装的每个版本的 NetBeans,userdir 将是一个唯一的子目录,例如 .netbeans/。
要找出您的确切 userdir 位置,请转到 IDE 的主菜单,然后选择“帮助”>“用户目录”。关于。 (Mac:NetBeans > 关于 NetBeans)。
NetBeans 7.1 允许使用开关 --cachedir 将缓存目录分离到所需位置。

示例
运行 NetBeans 5.0 的 Windows 用户 jdoe 可能会在下面找到他的 userdir
C:\Documents and Settings\jdoe.netbeans\5.0\
运行 NetBeans 5.0 的 Windows Vista 用户 jdoe 可能会在下面找到他的 userdir
C:\用户\jdoe.netbeans\5.0\
运行 NetBeans 5.0 的 Mac OS X 用户 jdoe 可能会在下面找到他的 userdir
/Users/jdoe/.netbeans/5.0/(要在 Finder 中打开此文件夹,请从 Finder 菜单中选择“前往”>“前往文件夹”,在框中键入 /Users/jdoe/.netbeans/5.0/,然后单击“前往”。 )
运行 NetBeans 5.0 的 Linux 用户 jdoe 可能会在下面找到他的 userdir
/home/jdoe/.netbeans/5.0/

有关详细信息,

请参阅 NetBeans 站点上的此文档:NetBeans 7.2 及更高版本

The NetBeans cachedir is a directory consisting of files that may become large, may change frequently, and can be deleted and recreated at any time. For example, the results of the Java classpath scan reside in the cachedir.

NetBeans 7.1 and older
By default the userdir is inside a (hidden) directory called .netbeans stored in the user's home directory. The home directory is ${HOME} on Unix-like systems, and %USERPROFILE% (usually set to C:\Documents and Settings\) on Windows. The cachedir can be found in var/cache subfolder of the userdir.
As the name suggests, the userdir is unique per user. For each version of NetBeans installed, the userdir will be a unique subdirectory such as .netbeans/.
To find out your exact userdir location, go to the IDE's main menu, and choose Help > About. (Mac: NetBeans > About NetBeans).
NetBeans 7.1 allows to separate the cache directory using a switch --cachedir to a desired location.

Examples
A Windows user jdoe running NetBeans 5.0 is likely to find his userdir under
C:\Documents and Settings\jdoe.netbeans\5.0\
A Windows Vista user jdoe running NetBeans 5.0 is likely to find his userdir under
C:\Users\jdoe.netbeans\5.0\
A Mac OS X user jdoe running NetBeans 5.0 is likely to find his userdir under
/Users/jdoe/.netbeans/5.0/ (To open this folder in the Finder, choose Go > Go to Folder from the Finder menu, type /Users/jdoe/.netbeans/5.0/ into the box, and click Go.)
A Linux user jdoe running NetBeans 5.0 is likely to find his userdir under
/home/jdoe/.netbeans/5.0/

For More Info

See this documentation at the NetBeans site: NetBeans 7.2 and newer

野却迷人 2024-12-30 17:46:06

对于 Windows 10 上的 NetBeans 8+,存在一个重复类错误的明确错误,可通过清理缓存来解决该错误
C:\Users\<用户>\AppData\Local\NetBeans\Cache

For NetBeans 8+ on Windows 10 there's a definitive bug with duplicate classes error which is being solved by cleaning the cache at
C:\Users\<user>\AppData\Local\NetBeans\Cache.

北音执念 2024-12-30 17:46:06

只需安装缓存擦除器插件,它兼容nb6.9、7.0、7.1、7.2和7.3:
要配置插件,您必须提供位于 netbean 的“关于”屏幕中的缓存目录。
然后使用“工具”->“擦除缓存”,清除 netbeans 缓存。
仅此而已,祝你好运。

http://plugins.netbeans.org/plugin/40014/cache-eraser

Just install cache eraser plugin, it is compatible with nb6.9, 7.0,7.1,7.2 and 7.3:
To configure the plugin you have to provide the cache dir which is in netbean's about screen.
Then with Tools->erase cache, you clear the netbeans cache.
That is all, good luck.

http://plugins.netbeans.org/plugin/40014/cache-eraser

忆离笙 2024-12-30 17:46:06

缓存为C:\Users\userName\AppData\Local\NetBeans\Cache\,然后该文件夹的版本名称将指定正确的缓存。

您还可以执行以下操作: 关闭 IDE。不要删除文件并冒一切风险,而是重命名此缓存文件夹。现在启动 IDE。一旦启动,将创建一个新的缓存文件夹,因为找不到该文件夹​​。现在您可以安全地删除重命名的文件夹。

The cache is C:\Users\userName\AppData\Local\NetBeans\Cache\, and then the version name of the folder will specify the correct cache.

You can also do this: Close the IDE. Instead, of deleting files and risking everything, rename this cache folder. Now start the IDE. Once it starts, a new cache folder will be created since the folder is not found. Now you can delete the renamed folder safely.

风渺 2024-12-30 17:46:06

tl;博士
您可能不需要破坏整个 NetBeans 缓存。


我的问题表现为,当我使用 NetBeans 8.0.2 时,运行干净构建不会删除以前的 build 文件夹或 testuserdir 文件夹。

当我第一次遇到这个问题时,雷·斯莱特的上述回答对我帮助很大。我有两个项目组,必须关闭两个组中的每个项目,关闭 NetBeans,清除缓存,然后将我的项目添加回我的组,然后才能再次工作。

后来,这个问题在 NetBeans 8.1 中再次出现。我关闭了 NetBeans,并在命令行中运行 ant build clean,结果成功了。当我重新打开 NetBeans 时,问题就解决了。我突然想到 NetBeans 使某些内容保持打开状态,只需将其关闭即可删除文件夹。


更新

我终于明白是怎么回事了。不知何故,我的 NetBeans“模块套件项目”(黄色/橙色拼图s图标)已关闭,并且“模块项目”(紫色拼图图标)具有相同的确切名称

现在我已经再次正确打开“模块套件项目”,一切都按预期进行。这解释了为什么 ant build clean 有效,因为它是在命令行上以正确的级别完成的,以清理整个套件。

我怀疑我根本不需要清理我的 NetBeans 缓存,尽管这样做实际上解决了为什么它只显示“模块项目”而不是“模块套件项目”的问题,从而在我单击了build clean...如果我只是意识到套件不再打开而只有项目打开,我可以在三秒钟内修复它。

tl;dr
You might not need to whack your entire NetBeans cache.


My problem manifested as running a clean build didn't delete the previous build folder or testuserdir folder, while I was using NetBeans 8.0.2.

The first time I had this problem, Ray Slater's answer above helped me immensely. I had two Project Groups, and had to close each project in both groups, close NetBeans, clear the cache, then add my projects back to my groups before it would work again.

Later, this problem cropped up again with NetBeans 8.1. I closed NetBeans, and ran ant build clean at the command line, and it worked. When I reopened NetBeans, the problem was resolved. It occurs to me that NetBeans was keeping something open and just needed to be closed in order to delete the folders.


Update

I finally figured out what was going on. Somehow, my NetBeans "Module Suite Project" (yellow/orange puzzle pieces icon) had been closed and the "Module Project" (purple puzzle piece icon) having the same exact name as the "Module Suite Project" was open. Building clean cleaned that particular Project correctly, but did not clean the entire Suite.

Now that I have the "Module Suite Project" opened correctly again, things work as expected. This explains why ant build clean worked, since it was done on the command line at the right level to clean the whole Suite.

I suspect I didn't strictly need to clean out my NetBeans cache at all though perhaps doing so actually fixed the issue of why it was only showing the "Module Project" instead of the "Module Suite Project", thereby doing the right thing when I clicked build clean... If I had simply realized that the Suite was no longer open and only the Project was, I could have fixed it in three seconds.

昵称有卵用 2024-12-30 17:46:06

我已经尝试过这个

UserName=radhason

C:\Users\radhason\AppData\Local\NetBeans\Cache

在此处输入图像描述

按确定按钮,然后将显示缓存文件夹并删除 netbeans 的此缓存文件夹。

I have tried this

UserName=radhason

C:\Users\radhason\AppData\Local\NetBeans\Cache

enter image description here

Press Ok button , then cache folder will be shown and delete this cache folder of netbeans.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文