Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    YU5Z8X2CvH1fv4ep
    @YU5Z8X2CvH1fv4ep
    通过实验发现补全速度和当前类的对象多少也有关,对象越多越慢
    主要是这个原因,jar的多少影响好像不是特被大
    vwkng
    @vwkng

    Hi everyone, when I import com.mypackage.abcde.ForecastRequestV1; in VSCode I am getting The import com.mypackage.abcde cannot be resolvedJava(268435846)

    In my .code-workspace file, under "java.project.referencedLibraries" I have the entry /path/to/my/jar-1.0.jar". When I open the jar file with vim, I see that com/mypackage/abcde/ForecastRequestV1.class is inside the jar file.

    Does anyone know how I can go about debugging why VSCode is complaining that com.mypackage.abcde cannot be resolved?

    (I've disabled all other JARs in my workspace and the results are the same)

    Tomer Eliyahu
    @tomereli
    Hi, is there any way to use environment variable for the port in launch.json attach?
    I tried "${env: MY_PORT}" but vscode refuses to use it cause it is not an integer
    Jinbo Wang
    @testforstephen

    Hi, is there any way to use environment variable for the port in launch.json attach?

    That's because we limit the scheme for port property to be number. Could you open a feature request against https://github.com/microsoft/vscode-java-debug/issues? // cc: @tomereli

    @vwkng Could you open Java Projects Explorer to see whether the referenced libraries are listed there? This is used to verify whether the libraries are added to the classpath correctly.
    Tomer Eliyahu
    @tomereli

    Hi, I'm having trouble setting up a new demo springboot application - I get timeout while waiting for completion of job: Initialize Wodkspace(30)
    I see in the client logs that it is stuck at importing the Maven project(s):

    {
      message: 'Params: {\n' +
        '    "id": "6cee0e87-cd77-496c-bca1-14fdf36f38e3",\n' +
        '    "task": "Importing Maven project(s)",\n' +
        '    "subTask": "https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-test/2.5.0-SNAPSHOT/maven-metadata.xml",\n' +
        '    "status": "Importing Maven project(s) - https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-test/2.5.0-SNAPSHOT/maven-metadata.xml",\n' +
        '    "totalWork": 1000,\n' +
        '    "workDone": 372,\n' +
        '    "complete": false\n' +
        '}\n' +
        '\n',
      level: 'info',
      timestamp: '2021-03-15 11:24:00.302'
    }

    I am working behind a corporate proxy, and am using zsh so I set up MAVEN_OPTS correctly in my .zshrc - so running mvn commands from shell works fine to download stuff, but I suspect that vscode is not picking it up.

    Any idea?

    Jinbo Wang
    @testforstephen
    @tomereli Here is a wiki about how to set the proxy for Java extension.https://github.com/redhat-developer/vscode-java/wiki/Using-a-Proxy
    Tomer Eliyahu
    @tomereli
    image.png

    @testforstephen thank you, In my environment, my proxy has no user and password, and we're using the same http proxy for both http and https:
    http_proxy environment variable is set to http://proxy.region.company.com:http-port
    https_proxy environment variable is set to http://proxy.region.company.com:https-port

    how do I set up my proxy and how do I verify the proxy configuration is correct? I'm trying to use the spring initiz extention to create a demo spring boot project, and I get that no JAVA projects are found after creation + all MAVEN plugins are missing, so I'm pretty sure it didn't work out for me.

    I also see a message that my setting will be overwritten:

    image.png
    Tomer Eliyahu
    @tomereli
    OK so according to the java configuration manual, setting only http.proxyHost and http.proxyPort should be enough, but apparently the settings do not propagate to the language server, as stated in the server logs I attached above.
    Valeriy Svydenko
    @svor
    Hello, I'm trying to debug quarkus application and got a problem that the debugger doesn't stop at breackpoint. Want to check if it could be related to vscode-java-debug. What i'm doing is:
    1. I opened getting-started app https://github.com/quarkusio/quarkus-quickstarts/tree/main/getting-started
    2. Package it (mvn package) and run in dev mode (mvn compile quarkus:dev -Dquarkus.http.host=0.0.0.0)
    3. Open file (GreetingResource) and set breakpoint on line 21
    4. Make small changes in the file (add spaces)
    5. Run debugger to attach to the app (it is important to attach after making changes)
      debug configuration is:
      {
       "type": "java",
       "request": "attach",
       "name": "Attach to Remote Quarkus App",
       "hostName": "localhost",
       "port": 5005
      }
    6. Open the application http://localhost:8080/hello/greeting/lola
    7. The debugger doesn't stop on the line with a breakpoint if add another breakpoint or even remove add current one and refresh the application , it'll work as expected
      Here is a screencast: https://www.youtube.com/watch?v=CAso9LDtX98
    hakamaru97
    @hakamaru97_twitter
    image.png

    Hello everybody. My name is Trung, i come from Vietnam.

    First, i'm so sorry about my english is not good, so i'm using google translate to connect with you guys. Seccond, if i got some stupid question or make you guys uncomfortable, please tolerate me. Thank you guys so much.

    My problem from Java Debug in Visual Studio Code. Today, i opened my code and ran, but i got the notice ( in the picture i pushed ). I have a question is: How to fix it ?

    Thanks for reading OwO

    Jinbo Wang
    @testforstephen
    @hakamaru97_twitter When you opened an unmanaged folder without any build tool such as maven or gradle, the Java tooling may not recognize those folders containing Java files well. That's why you see the warning "not on the classpath". Can you click the button "Add to Source Path" to add the file to classpath and try again?
    hakamaru97
    @hakamaru97_twitter
    Dear @testforstephen
    First, i'm very happy when u replied my question, thanks for this. Seccond, i fixed that bug by deleted VS Code and installed back VS Code, it worked ( lmao, i didn't how it worked ). I laughed all my morning .
    Back to my problem, thanks you again, have a nice day.
    amuradyan
    @amuradyan
    Hi
    I am trying to debug a remote maven failsafe run
    I am able to attach to the debugger, but my breakpoints are ignored
    I tried adding the source folder via configs but still no luck
    have you encountered something like this?
    Jinbo Wang
    @testforstephen
    @amuradyan From the description, we cannot tell what's wrong in your environment. Could you open an issue at https://github.com/microsoft/vscode-java-debug/issues and share the reproduce steps?
    Iven
    @ivenxu
    Hi, is there any setting controlling which packages/projects get compiled by auto-build? I have a big workspace, some times it just take too long.
    Praveen Nadarajah
    @praveennadarajah

    Hi,
    I'm willing to know how java supports code completion in debug console?

    AFAIU VS Code passes the frame/line information to the completion request. Then the debug adapter uses this information and contacts the language server for completion suggestions. If so, how the debug adapter and language server are integrated to support the code completion/auto-complete feature?

    It would be great if someone points me to some documentation in this regard.

    2 replies
    AlexMakesSoftware
    @AlexMakesSoftware
    Hi. I'm trying to debug my maven Java project but when I hit f5 I get a 'java.execute.workspaceCommand' failed error. How do I debug maven apps in Vis.Studio code?
    Sheng Chen
    @jdneo
    @AlexMakesSoftware Please provide more information to help us understand the problem. For example, you can provide a sample project.
    AlexMakesSoftware
    @AlexMakesSoftware
    Sure, here git@github.com:AlexMakesSoftware/prettyprinter.git is a project in github which uses Maven to control the build. I developed this using Visual Studio Code. I cannot seem to configure the debugger to debug this app. From what I've read, I should be able to go into any Java file, set a breakpoint and hit F5 to trigger the debugger - this doesn't seem to work.
    AlexMakesSoftware
    @AlexMakesSoftware
    Huh... never mind it seems to be working now. I guess restarting the IDE fixed it. ¯_(ツ)_/¯
    Sheng Chen
    @jdneo

    Huh... never mind it seems to be working now. I guess restarting the IDE fixed it. ¯_(ツ)_/¯

    Good to know problem solved

    John Grant
    @cyrfer
    i want to add a small improvement to this fantastic feature enhancement
    microsoft/vscode-java-debug#928
    i am limited in my java application debugging because i need to set a "multiline" value for an environment variable.
    dotenv has support for multiline values and integration looks very easy.
    https://github.com/motdotla/dotenv
    const dotenv = require('dotenv')
    const buf = Buffer.from('BASIC=basic')
    const config = dotenv.parse(buf) // will return an object
    John Grant
    @cyrfer
    per contributing.md, i submitted a feature request: microsoft/vscode-js-debug#1116
    John Grant
    @cyrfer
    oh dear, i submitted a feature request to the JS project, which also suffers from the same problem. :(
    John Grant
    @cyrfer
    here is the feature request issue for this project
    microsoft/vscode-java-debug#1061
    John Grant
    @cyrfer
    I submitted PRs to both projects
    in review: microsoft/vscode-java-debug#1062
    approved: microsoft/vscode-js-debug#1117
    Ganesh Raja
    @mrganeshraja
    image.png
    Hi Guys, I have this issue with the java debuggee times out while is trying to print a huge set of environment variables in the console. The huge set env variables are set by kubernetes bridge which allows for remote debugging .
    Any ideas are suggestion will be greatly appreciated, I tried with internal console but does not work well with K8s bridge debug
    thamas161819
    @thamas161819
    errror is coming while debug
    can anyone help me
    Jinbo Wang
    @testforstephen
    @mrganeshraja The terminal has the maximum length limits on the command line. You may change the console to internalConsole to avoid the length issue. You can add "console": "internalConsole" to your launch.json, or change the user setting "java.debug.settings.console": "internalConsole" for that.
    @thamas161819 could you pls provide more information about your issues?
    Okwara-Favour
    @Okwara-Favour
    I have a huge problem with Microsoft Debugger for Java extension. It stopped working for no reason recently on my visual studio code. How I know it is the extension at fault? Ans: I narrowed the problem to it and tested it using Vscodium and still it didn't work at all. Are you guys having technical problems over there all something
    Anushka Joshi
    @anushri:matrix.org
    [m]
    while running java program I get this error "Build failed , do you want to continue" , can anyone help me to solve this error??
    1 reply
    cayhorstmann
    @cayhorstmann

    I am trying to debug a Play framework application. With Eclipse, I start the app so that a debugger can attach, and then I use remote debugging. I added this to my launch.json in the configurations array:

    {
          "type": "java",
          "name": "Debug (Attach)",
          "request": "attach",
          "hostName": "localhost",
          "port": 9999,
          "projectName": "play-codecheck"
        },

    I also have another entry above that I need for another purpose. How do I switch between configurations? Whenever I select F5 or Run -> Start Debugging, it instantly uses the wrong configuration. Eclipse has an option to ask me nicely. How do I get VS Code to ask?

    Jinbo Wang
    @testforstephen
    image.png
    @cayhorstmann Pls refer to the screenshot above about how to switch between different launch configurations.
    cayhorstmann
    @cayhorstmann
    @testforstephen Thanks that worked! I also discovered a teensy icon in the status line all the way at the bottom (with a bug and a triangle) that lets you select the configuration. And C-S-p Select Debug works too.