简体   繁体   English

如何使用调试参数运行Swing应用程序

[英]How to run a Swing application with debug parameters

I want to debug a swing application remotely using JPDA, so that I can easily filter out the chunk of codes based on the user action rather than going through numerous methods and classes. 我想使用JPDA远程调试Swing应用程序,这样我就可以轻松地根据用户操作过滤掉代码块,而不必经过大量方法和类。 After checking on several websites and three swing specific books, the most detail I could find is 在检查了几个网站和三本关于摇摆的特定书籍之后,我能找到的最详细的信息是

Start your application, for example, by the following parameters, to debug them by means of the NetBeans IDE: 例如,通过以下参数启动应用程序,以通过NetBeans IDE对其进行调试:

-Xdebug -Xrunjdwp: transport=dt_socket,server=y,address=65535,suspend=n -Xdebug -Xrunjdwp:transport = dt_socket,server = y,address = 65535,suspend = n

What I am wondering is where do I provide these parameters. 我想知道的是在哪里提供这些参数。 Running the application through command line seems to be very cumbersome, as I am working on full fledged enterprise application with huge EJB and EAR. 通过命令行运行应用程序似乎非常麻烦,因为我正在开发具有大型EJB和EAR的成熟企业应用程序。 Also, it is a swing application and not a jar. 此外,它是一个摆动应用程序,而不是罐子。

Earlier I had debugged a SOAP web service and a VB client by starting wildfly in debug mode by inserting jvm-options node in %JBOSS_HOME%/domain/configuration/domain.xml using this SO post 早先,我通过使用此SO 帖子%JBOSS_HOME%/ domain / configuration / domain.xml中插入jvm-options节点以调试模式启动wildfly,从而调试了SOAP Web服务和VB客户端。

Debuggint the client this way made by work much easier. 通过这种方式调试客户端使工作变得更加容易。 I want to apply the same to this swing based application. 我想将相同的内容应用于此基于swing的应用程序。 Do I put the above mentioned paramenters in jvm-options only ? 我是否仅将上述参数放入jvm-options中 If yes, how do I know the value of port ? 如果是,我如何知道port的值?

The application consist of numerous modules most of them having their own swing UI. 该应用程序包含许多模块 ,其中大多数模块都有自己的swing UI。 So I think I cannot just run one swing ui through cli, passing these jvm parameters ? 所以我想我不能只通过cli运行一个swing ui,并传递这些jvm参数?

I found out in one of the books for Rich Client Platform development that each module of Netbeans is a jar by default. 我在一本有关Rich Client Platform开发的书中发现,默认情况下,Netbeans的每个模块都是一个jar。 The first module of the application to run is login module. 要运行的应用程序的第一个模块是登录模块。 I was able to debug the entire application using below command 我可以使用以下命令调试整个应用程序

java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n -jar login.jar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM