Disconnected from the target VM, address: '127.0.0.1:51928', transport: 'socket'

37,295

Solution 1

Java debugger prints the following message when it is connected to debugging port of JVM.

Connected to the target VM, address: '127.0.0.1:51928', transport: 'socket'

Similarly when your program terminates following message is printed to indicate that debugger has disconnected from the port.

Disconnected from the target VM, address: '127.0.0.1:51928', transport: 'socket'

Since these logs are written at the same time, console mixes them up.

Solution 2

I had similar problem with libGDX. It might have been related to my upgrade from 2017 to 2018 versions of IntelliJ. But it suddenly stopped working again, after I'd just recreated the project using the 2018 version to import a barebone libgdx project.

This might need a new question but I'm lazy so will piggyback my answer here.

As others point out, it is a debugging issue. (I don't actually understand what the OP of this question is asking, but the error looks right) I tried running without debugging and it fired up my previous version. "What good is code I can't change?" So I hit debug and sure enough I'm back on my new code's breakpoint.

Solution 3

The main method should be called the object of inherited method. Otherwise you can get the following error when you are debugging the class:

Connected to the target VM, address: '127.0.0.1:60102', transport: 'socket'
Disconnected from the target VM, address: '127.0.0.1:60102', transport: 'socket'

Solution 4

When you started your java program in debug mode, your IDE starts the JVM in debug mode (listening a socket to attach debugger). The statement starting with 'Connected ... ' shows your IDE connected to your debugging program, and 'Disconnected ...' shows your IDE disconnected from JVM because of your program is terminated.

Share:
37,295
Danpatpang
Author by

Danpatpang

Updated on January 03, 2021

Comments

  • Danpatpang
    Danpatpang over 3 years

    What does Disconnected from the target VM, address: '127.0.0.1:51928', transport: 'socket' mean?

    This is my code:

    import java.math.BigDecimal;
    public class puzzle2 {
        public static void main(String args[]){
            System.out.println(2.00-1.10);  //0.8999999999999999
            System.out.println(new BigDecimal("2.00").subtract(new BigDecimal("1.10")));    //0.10
        }
    }
    

    result is

    Connected to the target VM, address: '127.0.0.1:51928', transport: 'socket'
    
    0.8999999999999999
    
    0.90
    
    Disconnected from the target VM, address: '127.0.0.1:51928', transport: 'socket'