microsoft / microsoft/vscode-java-debug

Test build failure

未关闭
#1,431 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

ai-triaged question
主要语言
TypeScript
星标
591
派生
429
平均合并
1 天 9 小时
30 天内合并 PR
19

描述

Hello
I have a java project with gradle build.

I want to build with Java 8. My code used packages removed in java 11, for example javax.xml.bind.JAXBContext

So , in my build.gradle, I have

    java {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

And I can run gradle tasks build/check/test using the vscode gradle side bar item without issues.

But when I try to launch a test using Test runner, the gradle build fails with "error: package javax.xml.bind does not exist"
So it seems to build with Java 11!
So why? Does test runner uses another gradle version (where java sourceCompatibility/targetCompatibility is not supported)?
Does a workaround exists?
I checked also Command -> Configure java runtime , and I have Java 1.8 configured too.

Environment
  • Operating System: VScode is running on Windows 10 with a remote-ssh to a Linux workstation
  • JDK version: 1.8
  • Visual Studio Code version: 1.85.2
  • Java extension version: 0.25.15

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 build.gradle 中的 Java 兼容性设置开始,并比较报告的 remote-SSH 设置中的 Gradle 侧边栏构建与 Test runner 调用。检查配置的 Java 运行时,并确定测试路径无法解析 javax.xml.bind 的原因;完成标准是重现该不匹配并确定一个有文档记录或经过验证的修复方法。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, vscode
领域
build-system, devtools, testing
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。