vscode-java-debug icon indicating copy to clipboard operation
vscode-java-debug copied to clipboard

jdk17 source code, src.zip which is invisible

Open kirkzhangtech opened this issue 1 year ago • 4 comments

[provide a description of the issue]

Environment
  • Operating System:
            .-/+oossssoo+/-.               
        `:+ssssssssssssssssss+:`           ----------
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 20.04.6 LTS on Windows 10 x86_64
    .ossssssssssssssssssdMMMNysssso.       Kernel: 5.15.146.1-microsoft-standard-WSL2
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Uptime: 52 mins
  +ssssssssshmydMMMMMMMNddddyssssssss+     Packages: 1554 (dpkg)
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Shell: bash 5.0.17
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Terminal: Relay(9345)
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   CPU: 12th Gen Intel i5-12450H (12) @ 2.496GHz
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   GPU: 0010:00:00.0 Microsoft Corporation Device 008e
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   Memory: 2114MiB / 7799MiB
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   GPU Driver: Red Hat, Inc. Virtio console [1af4:1043] (rev 01)
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   CPU Usage: 6%
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    Disk (/): 48G / 1007G (5%)
  +sssssssssdmydMMMMMMMMddddyssssssss+     Battery1: 99% [Unknown]
   /ssssssssssshdmNNNNmyNMMMMhssssss/      Local IP: 172.29.183.120
    .ossssssssssssssssssdMMMNysssso.       Public IP: 120.239.70.3
      -+sssssssssssssssssyyyssss+-         Users: kirk
        `:+ssssssssssssssssss+:`           Locale: C.UTF-8
            .-/+oossssoo+/-.


  • JDK version: openjdk version "17.0.10" 2024-01-16 OpenJDK Runtime Environment (build 17.0.10+7-Ubuntu-120.04.1) OpenJDK 64-Bit Server VM (build 17.0.10+7-Ubuntu-120.04.1, mixed mode, sharing)

  • Visual Studio Code version: Version: 1.89.1 (user setup) Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685 Date: 2024-05-07T05:13:33.891Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Windows_NT x64 10.0.22631

  • Java extension version: Name: Extension Pack for Java Id: vscjava.vscode-java-pack Description: Popular extensions for Java development that provides Java IntelliSense, debugging, testing, Maven/Gradle support, project management and more Version: 0.26.0 Publisher: Microsoft VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack

  • Java Debugger extension version: Name: Debugger for Java Id: vscjava.vscode-java-debug Description: A lightweight Java debugger for Visual Studio Code Version: 0.57.0 Publisher: Microsoft VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-debug

Steps To Reproduce
  1. download openjdk17 source code
  2. configure src.zip as jre
  3. vscode could not select src.zip which is invisible

image

[attach a sample project reproducing the error] attach logs

Current Result
Expected Result
Additional Informations

kirkzhangtech avatar May 14 '24 14:05 kirkzhangtech

at the same time , go back function also not work https://github.com/microsoft/vscode-java-debug/assets/46363359/b6deb63a-ff45-405c-8fa9-37cae50c5595

kirkzhangtech avatar May 14 '24 14:05 kirkzhangtech

Could you pls provide the specific steps to reproduce the issue?

testforstephen avatar May 15 '24 02:05 testforstephen

  1. download src.zip by command sudo apt install openjdk-17-source
  2. unzip src.zip as jdk17se folder
  3. run code jdk17se
  4. config classpath on vscode at left java_project option

kirkzhangtech avatar May 17 '24 07:05 kirkzhangtech

{
    "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable",
    "java.configuration.runtimes": [
     
        {
          "name": "JavaSE-17",
          "path": "/usr/lib/jvm/java-17-openjdk-amd64",
          "sources" : "/usr/lib/jvm/openjdk-17/lib/src.zip",
          "default":  true
         }
      ]
}

i configured this env variables not work

kirkzhangtech avatar May 17 '24 08:05 kirkzhangtech

Hi @kirkzhangtech, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.

Suggestions

  • Use Java: Configure Java Runtime (via Command Palette) to add your JDK home, not the src.zip file. Point the JDK path to /usr/lib/jvm/openjdk-17 and let the extension find lib/src.zip automatically.

  • Alternatively, in your settings.json add:

    "java.configuration.runtimes": [
      {
        "name": "JavaSE-17",
        "path": "/usr/lib/jvm/openjdk-17"
      }
    ]
    

    Then run Java: Clean Java Language Server Workspace and reload VS Code.

References with high confidence

  • src.zip is not attached automatically (#3263) – shows how to configure java.configuration.runtimes correctly so that src.zip under lib is picked up automatically. https://github.com/redhat-developer/vscode-java/issues/3263
Other references with low confidence
  • Java extension: Failed to get sources. Instead, stub sources have been generated by the disassembler. (#2277) – describes missing sources causing fallback to disassembler stubs. https://github.com/redhat-developer/vscode-java/issues/2277

The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!

github-actions[bot] avatar Nov 10 '25 12:11 github-actions[bot]