You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Eclipse目标平台缓存创建位置判定及工作区异常问题咨询

Eclipse Target Platform Bundle Cache: Location Rules & Fix for Cross-Workspace Corruption

Cache Placement Rules

From my hands-on experience with Eclipse PDE, here’s why you’re seeing two distinct cache locations:

  • When your projects rely on Plugin-In Dependencies for resolution, Eclipse stores target platform bundles in your workspace’s .metadata\plugins\org.eclipse.pde.core.bundle_pool\plugins directory. This is a workspace-exclusive cache, tied directly to your current project set, designed to keep dependency resolution isolated per workspace.
  • The second location (eclipse\configuration\org.eclipse.osgi<numbers>\data<numbers>\plugins) activates when your target platform is configured to use the current Eclipse installation’s own plugins (e.g., you’ve pointed the target platform to your Eclipse install folder instead of a separate bundle set). This cache is linked to the running Eclipse instance, not your workspace—it’s a temporary runtime cache used by the OSGi framework for the active Eclipse process.

Why the Second Scenario Breaks Your Workspace

The core issue here is that this OSGi runtime cache isn’t built to handle multiple Eclipse instances accessing it simultaneously. When you launch a second Eclipse instance (even with the same target platform file), it will try to modify or lock the same cache files. This leads to corrupted bundle artifacts, file lock conflicts, or mismatched cache states. Your original workspace’s PDE then detects invalid cached bundles, triggering an infinite rebuild loop as it tries to repair the cache—only for the second instance to disrupt it again.

How to Fix the Infinite Rebuild Loop

Try these actionable steps to resolve the problem:

  • Switch to a workspace-isolated target platform: Create a dedicated .target file for your projects, configured to pull bundles from remote p2 repositories or a local standalone plugin directory (not your Eclipse install). This forces Eclipse to use the workspace-specific bundle_pool cache for both workspaces, eliminating cross-instance interference.
  • Force a custom cache (optional): If you prefer a shared or instance-specific global cache, add the JVM argument -Dorg.eclipse.pde.core.bundle_pool=C:\path\to\your\custom\cache to each Eclipse instance’s eclipse.ini file. Use a unique path per instance for full isolation, or a shared path with proper file permissions to avoid locks.
  • Clean corrupted caches: If you’re already stuck in the loop, close all Eclipse instances first. Delete the problematic OSGi cache directory (eclipse\configuration\org.eclipse.osgi<numbers>\data<numbers>\plugins) and clear the PDE cache in your workspace by removing .metadata\plugins\org.eclipse.pde.core. Restart Eclipse, and it will rebuild a clean, workspace-specific cache.

内容的提问来源于stack exchange,提问作者RGr

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.09 20:18:01