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

Eclipse产品导出缺失共享库:Tycho构建仍遇启动报错求助

解决方案:Eclipse 23-12产品导出缺失Native库导致启动报错

1. 校验Target Platform配置

  • 打开你的.target文件,确认已包含以下适配Eclipse 23-12的插件:
    • org.eclipse.equinox.launcher.gtk.linux.x86_64(Launcher的Native片段)
    • org.eclipse.swt.gtk.linux.x86_64(SWT的Native依赖)
  • 确保Target引用Eclipse 2023-12的完整发布仓库(https://download.eclipse.org/releases/2023-12/),避免仅引用部分插件仓库导致Native包缺失。
  • 使用Target Platform Editor的Validate功能检查是否存在未解析的Native artifacts依赖。

2. 修正Product文件配置

  • 打开LABX.product文件,切换到Configuration标签:
    • 确认已勾选Include native launcher artifacts选项;
    • 在插件列表中手动添加org.eclipse.equinox.launcher.gtk.linux.x86_64和org.eclipse.swt.gtk.linux.x86_64(自动依赖解析可能遗漏Native片段);
  • 切换到Launching标签,确认Launcher配置选择Linux GTK类型,且对应的Native插件已关联。

3. 调整Tycho POM配置

父项目POM

  • 确保Tycho版本与Eclipse 23-12兼容(推荐Tycho 4.0.0及以上版本),更新<tycho-version>属性。

产品模块(au.csiro.product)POM

  • 在tycho-product-plugin配置中显式开启Native artifacts包含:
    <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-product-plugin</artifactId>
        <version>${tycho-version}</version>
        <configuration>
            <productFile>LABX.product</productFile>
            <includeNativeArtifacts>true</includeNativeArtifacts>
            <archiveFormat>zip</archiveFormat>
        </configuration>
    </plugin>
    
  • 若使用tycho-p2-director-plugin构建,补充Native相关配置:
    <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-p2-director-plugin</artifactId>
        <version>${tycho-version}</version>
        <configuration>
            <product>au.csiro.product.LABX</product>
            <includeAllPlatforms>false</includeAllPlatforms>
            <includeNativeArtifacts>true</includeNativeArtifacts>
            <platform>gtk.linux.x86_64</platform>
        </configuration>
    </plugin>
    

4. 清理并重新构建

  • 执行命令彻底清理构建缓存并重新构建:
    mvn clean install -DskipTests
    
  • 查看构建日志,搜索native artifacts或org.eclipse.equinox.launcher.gtk关键字,确认Native插件被正常下载和打包。
  • 解压构建产物,检查plugins目录下是否存在org.eclipse.equinox.launcher.gtk.linux.x86_64_*.jar(内部包含.so文件),以及org.eclipse.swt.gtk.linux.x86_64_*.jar。

5. 手动排查P2 Director导出

  • 若Tycho构建仍有问题,尝试用P2 Director命令行手动导出,验证Native包是否能被正确获取:
    eclipse -application org.eclipse.equinox.p2.director \
      -repository https://download.eclipse.org/releases/2023-12/ \
      -installIU au.csiro.product.LABX \
      -destination ./output \
      -profile SDKProfile \
      -platform gtk.linux.x86_64 \
      -includeNativeArtifacts
    

6. 检查插件依赖配置

  • 由于未使用Features,确认核心插件的MANIFEST.MF中Require-Bundle包含org.eclipse.swt,且版本范围未限制到无法匹配Eclipse 23-12的Native片段。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.25 06:48:24