I am attempting to debug a remote Java application in a Linux environment with an argument. However, I can only find the option to define an argument when debugging a [local] Java application. The argument I am trying to define is java -Dsun.awt.disablegrab=true
to avoid having the system hang when I debug in event handlers. Given the nature of this application, I cannot launch it locally; I can only debug it as a remote Java application and define the host as localhost. Is there a way to launch debug for a remote Java application with the aforementioned argument?
Thanks to everyone in advance!
In order to allow opening the port for remote debugging, the application (or its server)'s launch will be parametrized with Java command-line arguments already, e.g. something in the lines of:
-Djava.compiler=NONE -Xdebug -Xnoagent
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=[your desired port]
I would simply add your desired parameter to the list, when you launch the process in debug mode.
Where to find the launch configuration will depend on the type of application you're running.
Since you likely already know the port to connect to, you may want to grep
it in your configuration files, in the targeted machine (i.e. in your local machine, in this specific case) - that might give you an idea what resource you need to make changes to.
Clarification
The idea here is that your local Eclipse is not launching the application when remote-debugging, it only connects to a socket of your own definition, with an open port to connect to your target machine.
Therefore, it it up to your application's launch configuration (i.e. how the java
process is parametrized when launching your application) to define the socket for remote debugging if so required, and any launch parameters you may want.