This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Can't create outgoing socket: UnknownHostException
- From: "Pering, Trevor" <trevor dot pering at intel dot com>
- To: <java at gcc dot gnu dot org>
- Date: Mon, 2 Jun 2003 11:04:48 -0700
- Subject: Can't create outgoing socket: UnknownHostException
I'm working with an arm-linux-gcj cross-compiler, and I get an error
where the compiled program can not create an outgoing connection -- it
always gets an UnknownHostException. I've distilled it down to the
following test program:
import java.net.*;
public class test {
public static void main(String argv[])
{
try {
new Socket("localhost",80);
System.out.println("Success");
} catch (Exception e) {
e.printStackTrace();
}
}
}
I'm using arm-linux-gcj version 3.3, compiling to test.bin (also using
javac to test.class). Which will either succeed or fail depending on how
I run it:
sh-2.03# java test
Success
sh-2.03# ./test.bin
java.net.UnknownHostException: localhost
<<No stacktrace available>>
Any idea what's going on here? I tried searching the mailing list, but
was unable to find anything that talked about this... (but there was a
lot of noise so I might have missed something).
Thanks,
Trevor