[java] Eclipse : Failed to connect to remote VM. Connection refused.

When ever i tried to launch my eclipse debug(for server side code) i'm getting the following error Failed to connect to remote VM. Connection refused.

What's the problem may be? I already tried with most of the solutions out in the web but none of that solved my issue. Could any one can assist me to fix this? Advance thanks..

This question is related to java eclipse connection remote-debugging

The answer is


As suat said, most of the time the connection refused is due to the fact that the port you set up is in use or there is a difference between the port number in your remote application debugging configuration in Eclipse and the port number used in the address attribute in

-Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n.

Check those things. Thanks!


Sometimes the port which you are trying to access, gets occupied and won't be released. Try some tools to find whether the port is in use or not. I also faced the same issue. I tried giving different port numbers but unfortunately it didn't work. I tried restarting the system (not the application server), and it worked :)


I ran into this problem debugging play framework version 2.x, turned out the server hadn't been started even though the play debug run command was issued. After a first request to the webserver which caused the play framework to really start the application at port 9000, I was able to connect properly to the debug port 9999 from eclipse.

[info] play - Application started (Dev)

The text above was shown in the console when the message above appeared, indicating why eclipse couldn't connect before first http request.


If you need to debug an application working on Tomcat, make sure that your Tomcat-folder/bin/startup.bat (if using windows) contains the following lines:

set JPDA_TRANSPORT="dt_socket"
set JPDA_ADDRESS=8000

call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%

when you have Failed to connect to remote VM Connection refused error, restart your eclipse


  • The port number in the Eclipse configuration and the port number of your application might not be the same.
  • You might not have been started your application with the right parameters.

    Those are the simple problems when I have faced "Connection refused" error.


I faced the same issue. But i resolved it by changing my port numbers to different one.


Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to eclipse

How do I get the command-line for an Eclipse run configuration? My eclipse won't open, i download the bundle pack it keeps saying error log strange error in my Animation Drawable How to uninstall Eclipse? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Class has been compiled by a more recent version of the Java Environment Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory How to downgrade Java from 9 to 8 on a MACOS. Eclipse is not running with Java 9 "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat

Examples related to connection

Apache Server (xampp) doesn't run on Windows 10 (Port 80) "Proxy server connection failed" in google chrome Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user 'root'@'localhost'(using password:YES) "The underlying connection was closed: An unexpected error occurred on a send." With SSL Certificate Login to Microsoft SQL Server Error: 18456 How do I start Mongo DB from Windows? java.rmi.ConnectException: Connection refused to host: 127.0.1.1; mySQL Error 1040: Too Many Connection org.apache.http.conn.HttpHostConnectException: Connection to http://localhost refused in android What is the functionality of setSoTimeout and how it works?

Examples related to remote-debugging

Adb over wireless without usb cable at all for not rooted phones Run local python script on remote server Eclipse : Failed to connect to remote VM. Connection refused. Accessing localhost (xampp) from another computer over LAN network - how to? Work on a remote project with Eclipse via SSH Running java with JAVA_OPTS env variable has no effect Remote debugging a Java application Debug JavaScript in Eclipse