Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    pdsharad
    @pdsharad
    v
    abstract class Bike{
    abstract void run();
    }
    class Honda4 extends Bike{
    void run(){System.out.println("running safely");}
    public static void main(String args[]){
    Bike obj = new Honda4();
    obj.run();
    }
    }
    please help me on the same
    Jinbo Wang
    @testforstephen
    @pdsharad Could you help open an issue at https://github.com/microsoft/vscode-java-debug/issues? Appreciate if you could provide more details about the reproduce steps.
    skumar-robomq
    @skumar-robomq
    Hi everyone,
    I have two maven project say A and B where A is mentioned as a dependency in B.
    I added both project to workspace and I started debugging in B.
    I set some breakpoints in A, and whenever the breakpoints are hit, it shows debugger in class file not .java file.
    the issue here is that I cannot modify class file while debugging also if have to set breakpoint i have to set in class file as well as .java file for future reference.
    I don't know whether its a maven issue ( I am pretty new to maven) or VScode debugging issue as this don't happen on eclipse.
    skumar-robomq
    @skumar-robomq
    I got why it's opening .class file because the the project B is using jar file of project A.
    Maven multi build project are not same as gradles one.
    Leo
    @arguser_gitlab
    Hell folks, after the latest update to VSCode and Docker Desktop I've experienced very slow performance with VSCode + Remote Containers (Java 8) and Java Language Server in general. Any way to debug and find the cause?
    No things like debugging or going to the implementation of a methods takes forever
    now* things
    Jinbo Wang
    @testforstephen
    @arguser_gitlab Looks like this is a VS Code issue, i assume you have already commented in the issue redhat-developer/vscode-java#1743
    @skumar-robomq Would you mind opening an issue at https://github.com/microsoft/vscode-java-debug/issues? Appreciate if you could provide a minimum sample project to help reproduce the issue.
    shivam kumar
    @Shiva7071007

    @skumar-robomq Would you mind opening an issue at https://github.com/microsoft/vscode-java-debug/issues? Appreciate if you could provide a minimum sample project to help reproduce the issue.

    It was not an issue. I was not aware of how maven and eclipse work.

    Chan Christian
    @GinoongFlores
    Hello, Everyone. I am new to this, I'm trying to hide the directory path when java executes a program in the terminal. Because I think when java displays the directory path in the terminal it's too long. I try to change the console into "internalConsole" it works fine and I know it only runs in the debug console and it cannot get input from the user. If java cannot hide the directory path in the terminal is there any way to customize or minimize the names in the path directory?
    shivam kumar
    @Shiva7071007
    @GinoongFlores can you post a screen shot
    Chan Christian
    @GinoongFlores
    Terminal.jpg
    @Shiva7071007 Here, sir. Is there any way to hide or minimize the directory path that java inputs in the terminal.
    shivam kumar
    @Shiva7071007
    @GinoongFlores Sorry brother but this not possible as issues regarding this were opened and closed.
    https://stackoverflow.com/questions/61176552/how-to-hide-file-paths-when-running-python-scripts-in-vs-code
    microsoft/vscode-go#219
    Sheng Chen
    @jdneo
    So far, if you want to launch your program in integrated terminal, I'm afraid there is no way to hide the path. But you can shorten the command. Search shortenCommandLine in this page for more detais: https://code.visualstudio.com/docs/java/java-debugging#_launch
    Chan Christian
    @GinoongFlores
    @jdneo @Shiva7071007 Thank You, I appreciate all your recommendations.
    Martin-zhangqizhou
    @Martin-zhangqizhou
    Hi, now I'm developing a project which needs to do something aims to visualize java file's execution progress. Can I get some info about StackFrame?(My English is not so good, sorry)
    Sheng Chen
    @jdneo
    @Martin-zhangqizhou You can find them in this view
    Screen Shot 2021-01-04 at 8.09.11 AM.png
    shivam kumar
    @Shiva7071007
    @jdneo I think he wants to know the tech behind stackframe. So that he can use that to create his project where he will visualize which JAVA file is executing.(this is what I understand, maybe I am wrong)
    Sheng Chen
    @jdneo
    @Shiva7071007 Thanks, I think you are right. Maybe @testforstephen can provide more details
    Jinbo Wang
    @testforstephen
    @Martin-zhangqizhou If you're talking about how to get the stack frame, the debugger is using JDI (Java Debug Interface) to fetch the stack frame where the program stops.
    YU5Z8X2CvH1fv4ep
    @YU5Z8X2CvH1fv4ep
    表哥们我的代码补全速度很慢怎么办
    半天显示不出来
    经过测试是因为我maven依赖的jar太多了
    有没有什么不修改代码仅仅通过改变配置就能解决这个问题的方法
    比如过滤某些路径的class
    java.completion.filteredTypes 这个设置好像没用
    我哦的写的com.*
    还是很慢
    有时候要3s才能反应过来很难受啊
    YU5Z8X2CvH1fv4ep
    @YU5Z8X2CvH1fv4ep
    我的电脑跟不上我的手指的速度
    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