我有一个在 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 应用程序
发布评论