javac -g option Create a class file with debug information in a java file. (* The class file is stored under the test directory.)
For that class file
A class file with the jdb main class

Execute the command with run.

] (3e909b4d989ea06006fa73f4aa419321.png)

If i search for "ERROR: transport error 202: gethostbyname: unknown host",
Link content
[Excerpt from the above site]
The jvm is trying to open the dt_socket at host Patricks-iMac.local, port 50547 but needs first to resolve that host name to an IP address. DNS lookup will fail since it's a dummy hostname assigned to a private address and DNS servers usually don 't know about them unless a sysadmin has configured them (companies use to do that). There are two solutions for this:

* I do not understand the meaning of the above English sentences. (Because the basic knowledge of DNS etc. is lacking in the first place.)
dt_socket/Patricks-Where is the file that specifies iMac.local/port 50547?
→ I checked it but it didn't come out.

● There are two methods presented as Answer. ↓

1) Add the hostname mapping on hosts file keeping other names configured for that IP localhost Patricks-iMac.local

* By the way, the contents of the/etc/hosts file on my PC are as follows.

2) Configure the dt_socket by IP address without touching hosts file (recommended)

-Xrunjdwp: transport = dt_socket, address =

2) Recommended for those who are supported. (Because I didn't want to mess with the files in the root directory.)

→ An error will occur.

In the first place, when debugging
java -Xrunjdwp: transport = dt_socket, address = Main
Is it executed by java command?
I'm not sure if it will be executed in the flow of jdb → run.
Is it feasible with either method?

[My environment]
macOS Big Sur version 11.0.1
Macbook pro 16 inch
[Java/javac version]

If anyone has any knowledge,
Could you please teach me?

  • Answer # 1

    I think it is necessary to pass the address as a compiler argument when RUN with jdb.

    I don't know what the program is doing in the first place, so I think it's hard to comment if you don't post the source code.
    If you are running a program without source code, you should compile it with jad.