There is no "lag" in TCP itself other than connection setup and any deliberate delay added by Nagle's algorithm, which you normally turn off when doing tiny packets and not streams. Java just uses the underlying OS's implementation, which may or may not be tuned well. If you have a firewall blocking path MTU discovery for example, you will lag like hell.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org