Hello,
The easiest to use the SAP MMC tool because you can check if the port (5xx08) is open and active on the host. By right clicking on the AS Java proces table -> icm node, you can select the AS Java telnet option.
If this does not work the problem must be network related.
Best Regards,
Peter