Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-debug-dev] Re: Debugging multiple processes?

So I'm trying number (1), but obviously I'm still not doing something
right.  I noticed JDK12DebugLauncher uses javaw instead of java, is this
important?  When you said "server=y", should I interpret that literally, or
is "y" a variable to be replaced with "localhost" or an IP?  Is -Xdebug
required?  I've tried many permutations, including:

java server=y address=8000 org.my.package.MyApplication
java -Xdebug -Dserver=y -Daddress=8000 org.my.package.MyApplication
java -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8000
org.my.package.MyApplication
...etc...

Sorry, I'm not very experienced in this area.  Could someone give an exact
java command line that launches a VM that I can debug from Eclipse?  I
think option (2) is not what I want, because my app is NOT a plug-in... I
don't want to copy wads of debug plug-in code just to launch a VM.

-----------------------

Darin said:

There are two things you could do

(1) If you launch the VMs, such that they can accept connections, then you
can use the "Remote Java Application" launcher to attach to the VMs after
they are launched. To do this, the VM needs to be launched with "server=y"
and "address=SOME_PORT" (i.e. 8000, or something). Then, from Eclipse,
select the project you are debugging (such that source can be located),
and from the "Debug" drop down menu on the tool bar, select "Debug ->
Remote Java Application". Type in the port the VM is listening on, press
finish, and you should have a debug session in Eclipse.

(2) The other thing to do, is to lanuch the VMs programatically. However,
all the code to do this is not (yet) API. You could look at the
"JDK12DebugLauncher" as an example.

Darin






Back to the top