microsoft / microsoft/vscode-java-debug

Test build failure

Open
#1,431 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ai-triaged question
Dominant language
TypeScript
Stars
591
Forks
429
Avg merge
1d 9h
Merged PRs (30d)
19

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the build.gradle Java compatibility settings and compare the Gradle sidebar build with the Test runner invocation in the reported remote-SSH setup. Check the configured Java runtime and determine why the test path cannot resolve javax.xml.bind; done means reproducing the mismatch and identifying a documented or verified fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
build-system, devtools, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.