How to debug a .bat file in eclipse?

Hail every body, I have a big dilemma. I am trying to understand a piece of Java code, but I cannot.

Here is the script.

I have a class (Embed.java) that is called using a .bat file, but when I try to debug code in java classes, I cannot do this because the debugger does not stop break points in java files. Also, when I execute the .bat file, I have no debugging capability. If anyone can help me, I really appreciate that.

In my .bat file, I have the following code:

java Insert lopez.bmp lopez.jpg -c "" -e bin.noise -p pleasechangethispassphrasetoyourown

Where: Embed is the main class that is called, and other parameters are inputs to this class.

+4
source share
1 answer

A few days later I received a decision on my transaction.

First of all, I created a new .bat file containing the following code:

java -Xdebug -Xrunjdwp: transport = dt_socket, server = y, suspend = y, address = 1044 -mx40M Insert lopez.bmp lopez.jpg -c "" -e bin.noise -p pleasechangethispassphrasetoyourown

This file allows me to remotely debug my application.

After that, in eclipse, I configured the launch of my .bat file, for this I used the external settings of the tools, and then in the optional program I created a new launch setting. In this window, in the location parameter, I entered the path to my new .bat file, and in the option working directory I entered the path to the folder containing my project. Now we can run this configuration, if everything is in order in the eclipse console, the following message is displayed:

Listening to the dt_socket transport at: 1044

Next, in the debug configuration option, select the remote java application option and create a new one. In the settings of this window, simply change the options port to 1044.

And thatโ€™s all.

+4
source

Source: https://habr.com/ru/post/1491241/


All Articles