From owner-freebsd-java@FreeBSD.ORG Fri Jun 6 12:41:08 2003 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1471637B404 for ; Fri, 6 Jun 2003 12:41:08 -0700 (PDT) Received: from ms-smtp-01.southeast.rr.com (ms-smtp-01.southeast.rr.com [24.93.67.82]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7209B43FBF for ; Fri, 6 Jun 2003 12:41:06 -0700 (PDT) (envelope-from mmercer@nc.rr.com) Received: from nc.rr.com (rdu88-246-041.nc.rr.com [24.88.246.41]) h56JZd5J023969; Fri, 6 Jun 2003 15:35:39 -0400 (EDT) Sender: mmercer@ms-smtp-01.southeast.rr.com Message-ID: <3EE0EE50.3BD60752@nc.rr.com> Date: Fri, 06 Jun 2003 15:41:04 -0400 From: Michael E Mercer X-Mailer: Mozilla 4.8 [en] (X11; U; Linux 2.4.2 i386) X-Accept-Language: en MIME-Version: 1.0 To: sagsag agsdgasg References: <20030606193806.91447.qmail@web20511.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: 'FreeBSD Java mailing list' Subject: Re: Java 1.4.1 InetAddress.getLocalHost() throws unexpected exception X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: mmercer@nc.rr.com List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2003 19:41:08 -0000 Do you have an entry in /etc/hosts for the name you set hostname to? If not, add an entry and retry your test program... I just set my hostname to "" and I get the unknownhost exception... I set it back and it works... the only difference I can see is you need an entry in /etc/hosts... HTH MeM sagsag agsdgasg wrote: > basically same result > > # hostname FreeBSD48 > # hostname > FreeBSD48 > # java Junk > running > java.net.UnknownHostException: FreeBSD48: FreeBSD48 > # > > could it be a something I'm missing in > /etc/namedb/named.conf ? > > --- Michael E Mercer wrote: > > Try this... > > > > > hostname where is the name you want > > your pc to have... > > > > then run your test program again... > > > > what happens? > > > > later > > MeM > > > > > > sagsag agsdgasg wrote: > > > > > hostname returns a blank line, i don't know what > > that > > > indicates. > > > # hostname > > > > > > # uname -a > > > FreeBSD 4.8-RELEASE FreeBSD 4.8-RELEASE #0: Thu > > Apr > > > 3 10:53:38 GMT 2003 > > > > > > root@freebsd-stable.sentex.ca:/usr/obj/usr/src/sys/GENERIC > > > i386 > > > > > > --- Michael E Mercer wrote: > > > > 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 @ ~ % 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 @ ~ % java Junk > > > > > running > > > > > .local./192.168.123.15 > > > > > end > > > > > -bash2.05b @ ~ % > > > > > > > > > > /* 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" > > > > > > > > > > __________________________________ > > > Do you Yahoo!? > > > Yahoo! Calendar - Free online calendar with sync > > to Outlook(TM). > > > http://calendar.yahoo.com > > > > __________________________________ > Do you Yahoo!? > Yahoo! Calendar - Free online calendar with sync to Outlook(TM). > http://calendar.yahoo.com