Make my program listen on a port.

Chong Yu Meng chongym
Wed Jun 14 09:24:33 PDT 2006


On Tue, 2006-06-13 at 09:08 -0700, altendew wrote:
> Its a program I downloaded.
> 
> /usr/local/bin/java
> 
> That is where it's saved as symlink. I need it to be ran as
> /usr/local/bin/java WAPID and running on port 1212

Hi Andrew,

A few things you may want to check:

1. When you run the command, "/usr/local/bin/java WAPID", what kind of
output do you get? In your previous post, it looked like there was no
output. If this is so, then it appears that the file WAPID.class is in
your CLASSPATH and clearly executing, because it returns you to the
prompt without errors. You may try to locate that file by doing "echo
$CLASSPATH" to discover what your CLASSPATH is currently set to. Then
you can use "find / -name WAPID.class" to find the file. 

2. You can check if the program is indeed listening on port 1212 by
doing "netstat -an | grep 1212". If the WAPID program is running, it may
very well be listening on port 1212. However, java programs can accept
arguments. That is, the program may already run on another port, and to
run the program on a port other than its default, you need to supply
"1212" after the command, i.e. "/usr/local/bin/java WAPID 1212" 

3. If you have access to the source code, you can check if the program
does accept arguments, or if there is a default port hard-coded into the
program. A faster way may be to ask the programmer himself/herself, if
you can find him/her.

Hope this helps!


-- 
Pascal Chong 
email:  chongym at cymulacrum.net 
web:    http://cymulacrum.net
pgp:    http://cymulacrum.net/pgp/cymulacrum.asc

"La science ne conna?t pas de fronti?re parce que la connaissance
appartient ? l?humanit?. et que c?est la flamme qui illumine le monde."

-- Louis Pasteur
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.linux-sxs.org/pipermail/linux-users/attachments/20060615/c53c9fd7/attachment.pgp 



More information about the Linux-users mailing list