This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]