• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

How to debug a remote application using Eclipse IDE.

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am running a remote java application in my desktop.
All the client side jars are downloaded to my local cache.
Now I want to debug the application using my Eclipse IDE.
I have found that to this i need to set some VM arguments, like
Xdebug Xrunjdwp:transport=dt_socket,server=localhost,address =5000

Can anybody tell me how can I set these parameters ?

Thanks in advance.

 
Marshal
Posts: 79704
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please read the important administrative private message I have just sent you.
 
Saloon Keeper
Posts: 28123
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hint: until you fix your display name, I'm not going to tell you the answer.

We're not trying to be unreasonable here, but we do try and maintain a certain degree of professionalism here. Despite the moth-eaten moose head logo.
 
Campbell Ritchie
Marshal
Posts: 79704
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Find the class with the main method in, r-click, then "run as" -> "open run dialog." (Or run configurations. There is a tab for arguments, with a box for command-line arguments, and a box for VM arguments.
 
Manu Manoharan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Campbell
Could you please tell me how can i debug remote application using eclipse?
 
Campbell Ritchie
Marshal
Posts: 79704
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I only know how to debug an ordinary application in Eclipse. Rather than run as you use debug as. You double-click the left side of the .java file, near the line numbers, until you see a blue circle, which represents a breakpoint. Execution continues to the breakpoint, then you can use step into, step over, and step return (or, I think f5 f6 and f7) and execute it bit by bit. You can also inspect the values of any variables as you go.
Is that any help?
 
Tim Holloway
Saloon Keeper
Posts: 28123
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for fixing your display name, Manu. Here's your answer.

The Java VM has built-in debugging capabilities. If you start a JVM and supply certain parameters, the JVM will start listening on a TCP/IP port for debug commands - in other words, it starts up a special debugging server as part of the Java runtime environment. There is no standard port number that I know of, although 8000 is popular. You tell it which port to use as part of the debugger options.

Although you can use this builtin debugger with a simple command-line interface, most Java IDEs can also use it, and that includes Eclipse. What you have to do is use the Debug setup dialog to create a Remote Debugging configuration . In that configuration, one of the options you must supply is the host location and debugging port number of the JVM that you want to debug. The host may be the same machine that Eclipse is running on, or some other machine - all that's required is a clear TCP/IP connection to the debugging server in the JVM under test.

The only other restriction is that Eclipse has to have filesystem access to source code that matches the compiled classes being tested. To work properly, that mans you should have defined an Eclipse project and be able to view and edit the source files in the usual way. If the source code doesn't match the compiled classes exactly, the debugger will get confused, and if there is no source code available, Eclipse will have only limited debugging abilities for that class.

The JVM debugger is very powerful and can be activated anywhere where you can control the startup of a JVM. For applets, that's done using the Java Control Panel. For servers like Tomcat, JBoss, and so forth, there's usually some way you can pass the debugger activation/setup parameters in as part of the server startup. For stand-alone Java applications, you just provide them on the startup command line.
 
Manu Manoharan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To debug client side applications, set the environment value

-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

(
PROCEDURE

For eg. in Windows, open System Prperties -> Advanced -> Environment variables -> System variables -> New.

Variable name : JAVA_DEBUG_ARG
Variable value : -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

)
 
Manu Manoharan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To debug client side applications, set the environment value

-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

(
PROCEDURE

For eg. in Windows, open System Prperties -> Advanced -> Environment variables -> System variables -> New.

Variable name : JAVA_DEBUG_ARG
Variable value : -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

Variable name : JAVAWS_TRACE_NATIVE
Value : 1

)
[/quote]
 
First, you drop a couch from the plane, THEN you surf it. Here, take this tiny ad with you:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic