我有一个在linux机器上运行的java应用程序。我使用以下代码运行java应用程序:
I have a java application running on linux machine. I run the java application using the following:
java myapp -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000, suspend=n我在这台Linux机器上为TCP打开了端口4000。我在Windows XP机器上使用eclipse并尝试连接到此应用程序。我也在Windows中打开了端口。
I have opened port 4000 for TCP on this Linux machine. I use eclipse from Windows XP machine and try to connect to this application. I have opened the port in windows also.
两台机器都在局域网上,但我似乎无法将调试器连接到Java应用程序。我做错了什么?
Both machines are on the LAN but I can't seem to connect the debugger to the Java application. What am I doing wrong?
推荐答案编辑:我注意到有些人正在切割和粘贴在这里调用。我最初给出的答案仅与OP相关。这是一种更现代的调用方式(包括使用更传统的8000端口):
I noticed that some people are cutting and pasting the invocation here. The answer I originally gave was relevant for the OP only. Here's a more modern invocation style (including using the more conventional port of 8000):
java -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n <other arguments>原始答案如下。
试试这个:
java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n myapp这里有两点:
更多推荐
远程调试Java应用程序
发布评论