Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Jython with non-server Java how to debug....

2010-09-16
2013-03-15
  • Jim Hargrave
    Jim Hargrave
    2010-09-16

    This has got to be an FAQ but I have googled for hours and haven't found an answer. I an running the latest pydev (1.6.2.2) with Eclipse 3.6. I have a Jython script that calls some *local* Java code. This is not server code, just some Java we have developed internally. I set a breakpoint in the Java source - but the debugger never stops in my Java code. Debugging within Jython works fine. If anyone can tell me if this should work and how to set it up I would be greatly appreciative. print statements from java sucks :-)

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2010-09-16

    Even being 'local' code, you have to choose one of them in 'remote' mode (either use the pydev debugger and debug java as a remote application or vice-versa).

    Cheers,

    Fabio

     
  • Jim Hargrave
    Jim Hargrave
    2010-09-16

    But how can I debug remotely a set of libraies - there is no main program to run on the Java side. Only a set of (many!) Eclipse projects which I reference from my jython script. Sorry if this is a noob question - but the only examples I see of remote debugging show a main application (usually server based) - not standalone library.

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2010-09-16

    You have to pass some flags to java.exe when running your jython program (-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n) and later in eclipse go to run > debug configurations > remote java application create a configuration to connect to it.

    Those flags should be specified in your jython launch configuration (in the vm arguments).

    Cheers,

    Fabio

    References:
    http://pydev.blogspot.com/2007/09/debugging-eclipse.html
    http://www.eclipsezone.com/eclipse/forums/t53459.html