我有一个.java文件,我将其部署到服务器并通过我的本地eclipse进行调试。我已经通过命令启动了应用程序
java -Xdebug -Xrunjdwp:transport=dt_socket,address=8998,server=y TestRemoteDebug
我也在eclipse中创建了正确的调试配置。
现在,当我启动应用程序时,我可以看到它遇到了断点,但是我无法在变量窗格中看到任何变量值,或者将鼠标悬停在变量上,因为它在本地机器中工作。
任何帮助表示感谢。
答案 0 :(得分:2)
使用javac -g
编译java文件修复此问题。
答案 1 :(得分:0)
如果您使用的是maven,则必须设置maven-compile-plugin
<!-- Compilation management -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
<debug>true</debug>
<verbose>true</verbose>
<optimize>true</optimize>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
</configuration>
</plugin>