Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Java Development User Guide
Previous Page Home Next Page

Remote Debugging

The client/server design of the Java debugger allows you to launch a Java program from computer on your network and debug it from the workstation running the platform.  This is particularly useful when you are developing a program for a device that cannot host the development platform.  It is also useful when debugging programs on dedicated machines such as web servers. 

Note:  To use remote debugging, you must be using a Java VM that supports this feature.

To debug a program remotely, you must be able to launch the program in debug mode on the remote machine so that it will wait for a connection from your debugger.  The specific technique for launching the program and connecting the debugger are VM-specific.  The basic steps are as follows:

  1. Ensure that you are building your Java program with available debug information.  (You page). 
  2. After you build your Java program, install it to the target computer.  This involves copying the .CLASS files or .JAR files to the appropriate location on the remote computer.
  3. Invoke the Java program on the remote computer using the appropriate VM arguments to specify debug mode and a communication port for the debugger.
  4. Start the debugger using a remote launch configuration and specify the address and port of the remote computer.

When setting up the remote launch configuration there are a few items to take note of:

  • You must ensure you enter the correct hostname i.e. the name of the remote computer where you are currently running your code. The hostname can also be the IP address of the remote machine, for example using 127.0.0.1 instead of localhost .
  • The port number must be the number of the port on the remote machine .

Certain Java VMs support another way of starting a remote debug session. In this alternative connection type, the debugger is launched first. The debugger then waits and listens for the VM to connect to it. To debug this way, you must properly configure and launch a remote debug session, then launch the VM, specifying the location of your waiting debugger. For more information, see Using the remote Java application launch configuration.

Related tasks

Using the remote Java application launch configuration
Disconnecting from a VM

 


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire