Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 Jun 2003 14:17:07 -0400
From:      Michael E Mercer <mmercer@nc.rr.com>
To:        sagsag agsdgasg <yoshideska@yahoo.com>
Cc:        freebsd-java@freebsd.org
Subject:   Re: Java 1.4.1 InetAddress.getLocalHost() throws unexpected exception
Message-ID:  <3EE0DAA3.728EAA64@nc.rr.com>
References:  <20030606180823.70140.qmail@web20511.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello peoples,

I just compiled and ran Junk.java below with no problems...

FreeBSD 4.8-STABLE...

What do you get when you run hostname from the command line?

later
MeM

sagsag agsdgasg wrote:

> x86 FreeBSD 4.8 Java 1.4.1 InetAddress.getLocalHost()
> throws unexpected exception. This program works on "OS
> X" and windows
>
> when the program ( below ) is run
>
> the FreeBSD 4.8 output is:
> # java -version
> java version "1.4.1-p3"
> Java(TM) 2 Runtime Environment, Standard Edition
> (build 1.4.1-p3-root_05_jun_2003_15_07)
> Java HotSpot(TM) Client VM (build
> 1.4.1-p3-root_05_jun_2003_15_07, mixed mode)
> # java Junk
> running
> java.net.UnknownHostException: :
> #
>
> the "OS X" output is:
> -bash2.05b <user>@<mycomp> ~ % java -version
> java version "1.4.1_01"
> Java(TM) 2 Runtime Environment, Standard Edition
> (build 1.4.1_01-39)
> Java HotSpot(TM) Client VM (build 1.4.1_01-14, mixed
> mode)
> -bash2.05b <user>@<mycomp> ~ % java Junk
> running
> <mycomp>.local./192.168.123.15
> end
> -bash2.05b <user>@<mycomp> ~ %
>
> /* file Junk.java */
>
> import java.io.*;
> import java.net.*;
>
> public class Junk
> {
>         public static void main( String[] argv )
>         {
>                 try
>                 {
>                         System.out.println( "running" );
>                         InetAddress x = InetAddress.getLocalHost( );
>                         System.out.println( x.toString( ) );
>                         System.out.println( "end" );
>                 }
>                 catch( IOException E )
>                 {
>                         System.out.println( E.toString() );
>                 }
>         }
> }
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
> _______________________________________________
> freebsd-java@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-java
> To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EE0DAA3.728EAA64>