You need to write a small Java Socket Listener, and you also
need to create the Socket in you AIR Application. Before starting
your AIR Application you need to start the SocketListener which
sits listening to the incoming connection from the AIR Application.

But you should use the same port at both the ends(Java and
AIR Application end).