Re: Need a Java/Linux RedHat 5.0 configuration where getLocalHost works

1998-06-17 Thread Per Widerlund

John A. Zinky wrote:
> We have not been able to find a configuration of Linux Red Hat 5.0 and
> jdk 1.1.x that works for the following one line test program.
> 
> public class TestGetLocalHost {
>   public static void main(String[] args) {
> try {
>   System.out.println(java.net.InetAddress.getLocalHost());
> } catch (Exception e) { e.printStackTrace(); }
>   }}
> 
> The Test program prints the IP address of local host
> (A necessary function for servers that need to publish their location)
> 
> On Solaris,NT, and  Red Hat 4.0/jdk1.1.3 this works: e.g:
>guava.bbn.com/171.78.82.34
> On Linux Red Hat 5.0 jdk1.1.5 this returns the loopback address: e.g:
>localhost/127.0.0.1
> 
> We have traced the problem in to the C routines for native platform
> on Line 298 in .../jdk1.1.5/src/java/net/InetAddress.java
> localHost.hostName = impl.getLocalHostName();
> System.out.println("local host name: " + localHost.hostName);
> 
> On linux: local host name: localhost
> On Solaris:   local host name: guava.bbn.com
> 
>  Questions *
> 1) Does anyone have a Linux RedHat 5.0 configuration where this program works?

It works fine for me: RedHat 5.0 and jdk1.1.6-v1 (sbb). Make sure you
have the
latest version of libc installed (can be found at www.redhat.com).

> [  ]
> 2) Could this be a configuration error in the linux host?

I believe that is the case. Try with DNS configured.

> [  ]

/Per Widerlund




Re: Need a Java/Linux RedHat 5.0 configuration where getLocalHost works

1998-06-17 Thread Stephen Wynne

In message <[EMAIL PROTECTED]>, "John A. Zinky"
writes:

We have not been able to find a configuration of Linux Red Hat 5.0 and
jdk 1.1.x that works for the following one line test program.

John, I tried this code on RH5 myself; same result.

In message <[EMAIL PROTECTED]>, Per Widerlund writes: 

It works fine for me: RedHat 5.0 and jdk1.1.6-v1 (sbb). Make sure
you have the latest version of libc installed (can be found at
www.redhat.com) . . . I believe that is the case. Try with DNS
configured.

Per,

I do; and this happens for me (v2 built by me). How is your DNS
configured? I'm not running DNS for that interface, BTW.

John A. Zinky continues:

We have traced the problem in to the C routines for native platform
on Line 298 in .../jdk1.1.5/src/java/net/InetAddress.java

It's in jdksrc/src/genunix/net/socket.c, yes.

b) We have tried several version of jdk1.1.5 and jdk1.1.6, 
   all of which we had a hard time installing.

What happened to make it difficult?

2) Could this be a configuration error in the linux host?

I'm wondering about that. I did look at /etc/nsswitch.conf; the
obvious tweaks there didn't change anything. Do you forward
hostname lookups to DNS, or are you fiddling with NIS? The
default seems to be to check NIS first. Try adjusting this...

3) Could we hack the C source for impl.getLocalHostName?

Well... I looked at this (briefly) and got lost. Here's what happens,
using "our" to loosely mean the JVM, which is "us" as we're running:

1. We call our own gethostbyname_r(), which calls gethostbyname()
   successfully, doing what you expect.
2. We then call our gethostbyaddr_r(), which calls Linux's gethostbyaddr_r().

At this point I get lost in glibc code, which I've unpacked on my system
and have stuffed into my GDB directory path. I went into it several times,
but didn't come up with an answer. Each time we go in there, we come
back with "localhost" and I didn't see why. I actually think this would
be obvious to someone who understands glibc.
   ^^^
4) Could this be a security feature?

No, I don't think so. Solaris would do it the same way then :) Maybe
someone else with access to the code and who's familiar with glibc
could give me a hand?

Thanks,

Steve




Re: Problems with SuperMojo

1998-06-17 Thread Uncle George

is it avail Free, or as a trial/demo test?

John Collins wrote:

> Has anyone gotten SuperMojo to work? I've got RedHat 5.0, jdk1.1.5v7.
> Lots of other Java stuff works. The two things that aren't working are
> SuperMojo (brand new, version 1.3) and Together/J (also brand new,






R: Problem extending an inner class

1998-06-17 Thread Daniele Lugli

Marcus,
Thank you very much for your interest. I was just taking the pen (hmm, no,
the keyboard) to write you a reply. I tried too the suggestion of Surya
Duggirala on my jdk 1.1.5v7 for linux i386, and it didn't work either. I
didn't receive any other suggestion. At present, what I am doing is to
avoid extending inner classes (if I have two similar inner classes, instead
of defining a common ancestor I code them both fully).
Best regards,
Daniele

--
> Da: Marcus Johnson <[EMAIL PROTECTED]>
> A: Daniele Lugli <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Oggetto: Re: Problem extending an inner class
> Data: martedì 16 giugno 1998 16.22
> 
> Daniele,
> 
> I got a chance to try this suggestion.  The suggester says it worked for
> him, but it didn't work for me on my Win95 machine running Sun's JDK
1.1.5
> .  Have you come up with anything further?
> 
> Marcus
> 
> 
> On Mon, 15 Jun 1998, Marcus Johnson wrote:
> 
> > Daniele,
> > 
> > I shared this problem on another Java forum and here's the first answer
I
> > got.  I haven't had a chance to try out the suggestion, but here it is:
> > 
> > Posted by Surya Duggirala <[EMAIL PROTECTED]> on June 15, 1998 at 16:19:12:
> > 
> > In Reply to: Problem extending inner classes 
> > 
> > In the actionPerformed(ActionEvent) method of Dialog1 class, call
> > dispose() method after System.out.println(). Then the code will work
> > properly.
> > 
> > Surya
> > 
> > 
> > On Wed, 17 Apr 1996, Daniele Lugli wrote:
> > 
> > > Could somebody try the following application? It raises a null
pointer
> > > exception when class Dialog2, extending class Dialog1, tries to
access a
> > > data member of the outer class.
> > > Please consider that I am really a java newbie (about 10 days of
> > > programming) so I'm not saying I've found a bug, the problem is
probably
> > > mine.
> > > 
> > > Thank you,
> > > Daniele Lugli
> > > 
> > > 
> > > // File name: Wrong.java
> > > 
> > > import java.awt.*;
> > > import java.awt.event.*;
> > > import java.lang.String;
> > > import java.text.*;
> > > import java.util.*;
> > > 
> > > public class Wrong extends Frame {
> > > 
> > >   public static void main (String args[]) throws Exception {
> > > new Wrong ();
> > >   }
> > > 
> > >   public Wrong () throws Exception {
> > > super ();
> > > setBounds (300, 100, 300, 100);
> > > setVisible (true);
> > > 
> > > i = 5;
> > > 
> > > new Dialog2 (this);
> > >   }
> > > 
> > >   private void quit () {
> > > setVisible (false);
> > > dispose ();
> > > System.exit (0);
> > >   }
> > > 
> > > 
> > >   class Dialog1 extends Dialog implements ActionListener {
> > > Dialog1 (Frame parent) {
> > >   super (parent, "Dialog", true );
> > >   setBounds (400, 200, 100, 75);
> > >   okButton = new Button ("OK");
> > >   okButton.addActionListener (this);
> > >   add (okButton);
> > >   setVisible (true);
> > > }
> > > public void actionPerformed (ActionEvent aevt) {
> > >   
> > >   System.out.println ("Dialog1: i=" + i);
> > > 
> > > }
> > > private Button okButton;
> > >   }
> > > 
> > >   class Dialog2 extends Dialog1 {
> > > Dialog2 (Frame parent) {
> > >   super (parent);
> > > }
> > > public void actionPerformed (ActionEvent aevt) {
> > >   super.actionPerformed (aevt);
> > >   
> > >   System.out.println ("Dialog2: i=" + i);
> > > 
> > >   quit ();
> > > }
> > >   }
> > > 
> > >   int i;
> > > 
> > > }
> > > 
> > 
> > 




Re: Need a Java/Linux RedHat 5.0 configuration where getLocalHost works

1998-06-17 Thread B. Craig Taverner

> >   System.out.println(java.net.InetAddress.getLocalHost());
> It works fine for me: RedHat 5.0 and jdk1.1.6-v1 (sbb). Make sure you

Also works for me: Debian1.3.1, libc5.4.33 (no glibc), kernel2.0.33,
jdk1.1.3.

Could it be a glibc bug?

Cheers, Craig

--
 The sooner you fall behind, the more time you'll have to
 catch up. (Project Management at its best).

==
Craig Taverner   --==   Email:[EMAIL PROTECTED]
ComOpt AB   --Tel:   +46-42-212580
Michael Löfmans Gata 6 --==   Fax:   +46-42-210585
SE-254 38 Helsingborg   --   Cell:  +46-708-212598
Sweden   --==http://www.comopt.com
==




Re: Need a Java/Linux RedHat 5.0 configuration where getLocalHost works

1998-06-17 Thread Stefan Andreasen

I dont run DNS and as I said in my previous mail, the program works fine for
me.

Stefan

-Original Message-
From: Per Widerlund <[EMAIL PROTECTED]>
To: John A. Zinky <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, June 17, 1998 09:22
Subject: Re: Need a Java/Linux RedHat 5.0 configuration where getLocalHost
works


>John A. Zinky wrote:
>> We have not been able to find a configuration of Linux Red Hat 5.0 and
>> jdk 1.1.x that works for the following one line test program.
>>
>> public class TestGetLocalHost {
>>   public static void main(String[] args) {
>> try {
>>   System.out.println(java.net.InetAddress.getLocalHost());
>> } catch (Exception e) { e.printStackTrace(); }
>>   }}
>>
>> The Test program prints the IP address of local host
>> (A necessary function for servers that need to publish their location)
>>
>> On Solaris,NT, and  Red Hat 4.0/jdk1.1.3 this works: e.g:
>>guava.bbn.com/171.78.82.34
>> On Linux Red Hat 5.0 jdk1.1.5 this returns the loopback address: e.g:
>>localhost/127.0.0.1
>>
>> We have traced the problem in to the C routines for native platform
>> on Line 298 in .../jdk1.1.5/src/java/net/InetAddress.java
>> localHost.hostName = impl.getLocalHostName();
>> System.out.println("local host name: " + localHost.hostName);
>>
>> On linux: local host name: localhost
>> On Solaris:   local host name: guava.bbn.com
>>
>>  Questions *
>> 1) Does anyone have a Linux RedHat 5.0 configuration where this program
works?
>
>It works fine for me: RedHat 5.0 and jdk1.1.6-v1 (sbb). Make sure you
>have the
>latest version of libc installed (can be found at www.redhat.com).
>
>> [  ]
>> 2) Could this be a configuration error in the linux host?
>
>I believe that is the case. Try with DNS configured.
>
>> [  ]
>
>/Per Widerlund




Re: Need a Java/Linux RedHat 5.0 configuration where getLocalHost works

1998-06-17 Thread Joe Carter

Stephen Wynne wrote:
> 
> In message <[EMAIL PROTECTED]>, "John A. Zinky"
> writes:
> 
> We have not been able to find a configuration of Linux Red Hat 5.0 and
> jdk 1.1.x that works for the following one line test program.
> 
> John, I tried this code on RH5 myself; same result.
> 
Change the order of localhost and the real host name in /etc/hosts.
(real first!). The getlocalhost just seems to get the first it finds.

Works ok for me then.

-- 
Joe Carter  Software Engineer
Brite Voice Systems Ltd, Gatley, Cheshire. UK.
mailto:[EMAIL PROTECTED]




InetAddr.getLocalHost() [glibc?] bug workaround

1998-06-17 Thread Geoffrey S. Knauth

Joe Carter suggested:
> Change the order of localhost and the real host name in /etc/hosts.
> (real first!). The getlocalhost just seems to get the first it finds.

I tried this straightforward workaround, as silly as it seemed, and
the "GNU/Linux JDK InetAddr.getLocalHost() on glibc bug" vanished
immediately.  I'm wondering why someone might have coded things this
way, since ordinarily people don't change their /etc/hosts file every
time they switch between interfaces (e.g., ppp0 at home, eth0 at
work).  So I'd consider this a glic bug, unless it turns out the
code in getlocalhost() has a reason behind it.

-- 
Geoffrey S. Knauth   http://world.std.com/~gsk

---
> From: "John A. Zinky" <[EMAIL PROTECTED]>

We have not been able to find a configuration of Linux Red Hat 5.0 and
jdk 1.1.x that works for the following one line test program.

public class TestGetLocalHost {
  public static void main(String[] args) {
try {
  System.out.println(java.net.InetAddress.getLocalHost());
} catch (Exception e) { e.printStackTrace(); }
  }}

The Test program prints the IP address of local host 
(A necessary function for servers that need to publish their location)

On Solaris,NT, and  Red Hat 4.0/jdk1.1.3 this works: e.g:
   guava.bbn.com/191.79.84.43
On Linux Red Hat 5.0 jdk1.1.5 this returns the loopback address: e.g:
   localhost/127.0.0.1

We have traced the problem in to the C routines for native platform
on Line 298 in .../jdk1.1.5/src/java/net/InetAddress.java
localHost.hostName = impl.getLocalHostName();
System.out.println("local host name: " + localHost.hostName);

On linux: local host name: localhost
On Solaris:   local host name: guava.bbn.com

 Questions *
1) Does anyone have a Linux RedHat 5.0 configuration where this program works?

a) jdk1.1.3 does not work under RedHat 5.0 because it uses libc and not glibc
   Is there a way to shimmy in libc just for this one java executable?

b) We have tried several version of jdk1.1.5 and jdk1.1.6, 
   all of which we had a hard time installing.

c) How about a statically linked version of jdk1.1.x?

2) Could this be a configuration error in the linux host?

3) Could we hack the C source for impl.getLocalHostName?
 a) Where is the source code?
 b) Where is the Make?

4) Could this be a security feature?
 The news groups has lots of chatter on why getLocalHosts should not
 give the IP address IN THE CASE OF APPLETS.
 But this case, we have a SERVER, so it needs to get it's own address.

thanks
zinky




Re: Need a Java/Linux RedHat 5.0 configuration where getLocalHost works

1998-06-17 Thread David Lucas

On my box using java version "Sergey_Nikitin:12/21/97-23:13"   and
glibc2 ( /lib/libc-2.0.5.so) the java.net.InetAddress.getLocalHost()
returns the name configured by the "hostname " command.  Which also
is looked up for the IP address in the /etc/hosts file (not sure if it
uses DNS or not), but, if you have a valid ip associated with the
hostname, then all is well.

Take a look at hostname output and /etc/hosts and verify it is the right
ip address for your network.

My 2 cents...

Later,
Dave

-- 

++
| David Lucas  mailto:[EMAIL PROTECTED]|
| Software Engineer  |
| C++,Unix,Client/Server,Zinc,Java   |
++
| GPS Location:  40 deg 00' 51" N,  82 deg 38' 11" W |
| IMHC: "Jesus Christ is the way, the truth, and the life."  |
| IMHC: "I know where I am; I know where I'm going." |
++

Notes:
IMHO: in my humble opinion   IMHC: in my humble conviction 
PGP Key Block:  finger [EMAIL PROTECTED]
All trademarks above are those of their respective owners.




Re: Need a Java/Linux RedHat 5.0 configuration where getLocalHost works

1998-06-17 Thread ptoscano


John,

I'll bet that the first line in your /etc/hosts is:

127.0.0.1   localhost localhost.localdomain

At least, that's the way it was with mine and, when I tried your program, I 
got the same "broken" answer you got.  After reading Per's message, I moved 
that line below the second line in my /etc/hosts so that it looks like this:

198.41.2.245knight.internic.net knight
127.0.0.1   localhost localhost.localdomain

Guess what?  It now works correctly.  I have a feeling that it shouldn't be 
dependent on your /etc/hosts entry order, but at least this will account for 
the difference between your and Per's results.

BTW, I'm testing this on a RH 5.1 system with sn's jdk-1.1.6v1.2.

pete

] John A. Zinky wrote:
] > We have not been able to find a configuration of Linux Red Hat 5.0 and
] > jdk 1.1.x that works for the following one line test program.
] > 
] > public class TestGetLocalHost {
] >   public static void main(String[] args) {
] > try {
] >   System.out.println(java.net.InetAddress.getLocalHost());
] > } catch (Exception e) { e.printStackTrace(); }
] >   }}
] > 
] > The Test program prints the IP address of local host
] > (A necessary function for servers that need to publish their location)
] > 
] > On Solaris,NT, and  Red Hat 4.0/jdk1.1.3 this works: e.g:
] >guava.bbn.com/171.78.82.34
] > On Linux Red Hat 5.0 jdk1.1.5 this returns the loopback address: e.g:
] >localhost/127.0.0.1
] > 
] > We have traced the problem in to the C routines for native platform
] > on Line 298 in .../jdk1.1.5/src/java/net/InetAddress.java
] > localHost.hostName = impl.getLocalHostName();
] > System.out.println("local host name: " + localHost.hostName);
] > 
] > On linux: local host name: localhost
] > On Solaris:   local host name: guava.bbn.com
] > 
] >  Questions *
] > 1) Does anyone have a Linux RedHat 5.0 configuration where this program works?
] 
] It works fine for me: RedHat 5.0 and jdk1.1.6-v1 (sbb). Make sure you
] have the
] latest version of libc installed (can be found at www.redhat.com).
] 
] > [  ]
] > 2) Could this be a configuration error in the linux host?
] 
] I believe that is the case. Try with DNS configured.
] 
] > [  ]
] 
] /Per Widerlund
] 





Re: Problems with SuperMojo

1998-06-17 Thread Sze Yuen Wong

I also got some problem with SuperMojo and 1.1.5v7, but a different one.

I can't run any applet or application from the IDE, every time I push
the "play"
button, a status bar came up for some time and then disappeared. No
thing happened.
It always generate an NullPointerException.

Sze




Re: Problems with SuperMojo

1998-06-17 Thread Sze Yuen Wong

You can download a evaluation copy of supermojo from:

http://www.softseek.com/Programming/Java/Review_13665_index.html

Sze.





Re: Need a Java/Linux RedHat 5.0 configuration where getLocalHost works

1998-06-17 Thread Karl Asha

The answer is pretty simple. The JDK finds out its information using 
gethostname(). This information is something that's been previously
set at system boot up with the sethostname syscall. The problem isn't really
the jdk, it's how your system is setup. If you type 'hostname' on the command
line, and you get localhost, that's what java's getLocalHost() is gonna
give you too. You need to look into having your machine setup correctly, 
and that usually revolves around a properly setup /etc/hosts. 

That's pretty much the extent of getLocalhost()...it does a gethostname, 
a gethostbyname to pull up the full host/domain, and then a gethostbyaddr
to provide you the address. 

Hope this helps out, 
Cheers, 
Karl Asha
[EMAIL PROTECTED]


"John A. Zinky" <[EMAIL PROTECTED]> writes:
> We have not been able to find a configuration of Linux Red Hat 5.0 and
> jdk 1.1.x that works for the following one line test program.
> 
> public class TestGetLocalHost {
>   public static void main(String[] args) {
> try {
>   System.out.println(java.net.InetAddress.getLocalHost());
> } catch (Exception e) { e.printStackTrace(); }
>   }}
> 
> The Test program prints the IP address of local host 
> (A necessary function for servers that need to publish their location)
> 
> On Solaris,NT, and  Red Hat 4.0/jdk1.1.3 this works: e.g:
>guava.bbn.com/171.78.82.34
> On Linux Red Hat 5.0 jdk1.1.5 this returns the loopback address: e.g:
>localhost/127.0.0.1
> 
> We have traced the problem in to the C routines for native platform
> on Line 298 in .../jdk1.1.5/src/java/net/InetAddress.java
>   localHost.hostName = impl.getLocalHostName();
>   System.out.println("local host name: " + localHost.hostName);
> 
> On linux: local host name: localhost
> On Solaris:   local host name: guava.bbn.com
> 
>  Questions *
> 1) Does anyone have a Linux RedHat 5.0 configuration where this program works?
> 
> a) jdk1.1.3 does not work under RedHat 5.0 because it uses libc and not glibc
>Is there a way to shimmy in libc just for this one java executable?
> 
> b) We have tried several version of jdk1.1.5 and jdk1.1.6, 
>all of which we had a hard time installing.
> 
> c) How about a statically linked version of jdk1.1.x?
> 
> 2) Could this be a configuration error in the linux host?
> 
> 3) Could we hack the C source for impl.getLocalHostName?
>  a) Where is the source code?
>  b) Where is the Make?
> 
> 4) Could this be a security feature?
>  The news groups has lots of chatter on why getLocalHosts should not
>  give the IP address IN THE CASE OF APPLETS.
>  But this case, we have a SERVER, so it needs to get it's own address.
> 
> thanks
> zinky




Re: Need a Java/Linux RedHat 5.0 configuration where getLocalHost works

1998-06-17 Thread Geoffrey S. Knauth

Karl,

  I got a different result.  When I've typed `hostname' on my
GNU/Linux machine, I've always gotten "zhivago.bbn.com", never
"localhost".  When I first ran John Zinky's one-line test program, I
got localhost/127.0.0.1.  When I put the "zhivago" line in /etc/hosts
above the "localhost" line, only then did I get the correct output
from the test program.

Geoffrey

-- 
Geoffrey S. Knauth   http://world.std.com/~gsk




Re: Need a Java/Linux RedHat 5.0 configuration where getLocalHost works

1998-06-17 Thread Nelson Minar

one more datapoint - I have localhost as the first entry in /etc/hosts
(where it belongs, I might add), but the test program correctly prints
out pinotnoir.media.mit.edu/18.85.16.104

What's the difference? I'm not running glibc, I'm using libc5. My
system is a mostly-Redhat-4.1 system with libc-5.3.12 and java version
"Linux_JDK_1.1.5_v7".

glibc must be doing something different. Whether it's a bug or a
misfeature, I wouldn't want to guess.




Re: Free Builder?

1998-06-17 Thread Sze Yuen Wong

> Currently, FreeBuilder is in Version 0.7.1 and reportedly support
> JDK1.1.5  and Swing 1.0.1. I have tried it on Linux jdk1.1.5. However,
> it can not come up under Linux jdk1.1.6-v2_test.
>
> ---yan

Where can I get it? Is it stable enough to actually program in it?

Thanks,

Sze Yuen






Unidentified subject!

1998-06-17 Thread Steve Byrne

Waldir Borba Junior writes:
 > unsubscrib

Here's a hint:

It's spelled:

 unsubscribE
   ^
   |
   |
   |
   |
   |


Get it?  Now, get this: you DO NOT send to the java-linux mailing address to be
UNSUBSCRIBEd!   Doing so just makes you look like a CLUELESS NEWBIE!

Send to [EMAIL PROTECTED] instead.  I think this
information was sent to you when you subscribed, and I think it's available at
the java.blackdown.org web site if you'd take the time to look.

Steve




Re: JClass or Swing

1998-06-17 Thread Maureen Lecuona

Just one comment: JClass offers more functionality than Swing does.


JTable, JField are timesavers for the most part.  Support is not
the best, but the widgets are very simple to use







Re: InetAddr.getLocalHost() [glibc?] bug workaround

1998-06-17 Thread Christopher Seawood

On Wed, 17 Jun 1998, Marc Evelyn wrote:

> On Wed, 17 Jun 1998, Christopher Seawood wrote:
> 
>  # Yes, this does seem to be a glibc bug.  The attached code is the gist of
>  # getLocalHost().  It returns the correct result on my machine at work
>  # running glibc 2.0.6 but returns the first entry in /etc/hosts on my
>  # machine at home running redhat's glibc 2.0.7-13.  
>  #
> 
> That code (getlocalhost.c) works fine here:
> 
> Red Hat 5.0, 2.0.34, 2.0.7-13, and the first entry in /etc/hosts is
> 'localhost' (127.0.0.1)
> 
> 19:33:45 (mast)$ gcc getlocalhost.c 
> 19:42:50 (mast)$ ./a.out 
> Hostname: mast.interlog.com

After some further testing, diz & I discovered that getlocalhost will
work properly if:
1) /etc/hosts does not contain an entry for your machine 
or  2) the /etc/nsswitch.conf hosts line has dns before files

- cls





Re: out of memory

1998-06-17 Thread pat cavanagh



Richard Hall wrote:

> I've just begun using JDK1.1.6 on my Debian 2.0.29 machine, and the
> compiler often, but not always claims to be out of memory.  top says:
>
> Mem:   14324K av,  14020K used,304K free,   8732K shrd, 92K buff
> Swap:  32252K av,  17908K used,  14344K free  3616K cached
>
> The compiler has bailed with close to 1M of RAM free.  The only things
> running while this is happening besides a few xterms are X, Netscape, and
> XEmacs.  Do I need to add more swap or what?
>

netscape and emacs both gobble prodigious amounts of memory, and you
don't have a whole lot to start with. try shutting down netscape (naturally
i would never advocate shutting down emacs, keep that running until you
shut down the system!). you could use more swap but you may end up with
a whole lot of swapping going on. you probably need more memory.

kanpai!
pat





Re: PLEASE help! Java Web Server 1.1

1998-06-17 Thread Juergen Kreileder

Richard Hakim <[EMAIL PROTECTED]> writes:

> Hi -
> 
> I guess you're all probably really tired of people asking for help with
> this, but...
> 
> I'm trying to get the Java Web Server 1.1 running.  I'm trying to follow
> the directions on java-linux.org, but am having trouble.  I've got the
> Solaris version, and I've got jwebs-linux.diff, but when I ran it
> through patch it bailed with errors.  So then I tried applying the patch
> by hand, but clearly I did something wrong because my Makefile.lnx
> wouldn't do anything, and it was too complicated for me to figure out.
> 
> Can anyone help me??  Please??
> 
> I'm running RH5.1, so if there's a working Java Web Server RPM that'd be
> awesome.  Or even a tarball of a working installation would be great. 
> If not, if _anyone_ could offer to help me out that'd be great.
> 
> Many thanks,
> 
> Richard

Just untar it, set JAVA_HOME to the appropriate directory and
say './JavaWebServer1.1/bin/http -nojre'.

This works at least on my system (with the Solaris Sparc jws). 
You will get two error messages about native libs included in the 
solaris version. And the Admin Applet sometimes doesn't show up at
the first try.

Jürgen

-- 
Juergen Kreileder, Universitaet Dortmund, Lehrstuhl Informatik V
Baroper Strasse 301, D-44221 Dortmund, Germany
Phone: ++49 231/755-5806, Fax: ++49 231/755-5802




Re: Java and C interaction via stdin/stdout

1998-06-17 Thread Stephen Wynne

In message
<[EMAIL PROTECTED]>, Richard
Hall writes:

Runtime.getRuntime().exec("/usr/games/monop"); works just fine,
but Process.getInputStream() doesn't seem to work.

Richard,

It's not exactly "C interaction" that you mean here. There's 1.1 JNI (Java
Native Interfaces) for that.

Has anyone succeeded at getting a Java program to interact with a C
program via stdin/stdout?  If so, how?  If not, can you explain the
behavior of the following code?  (JDK 1.1.6 and Debian 2.0 libc5, i386)

I didn't see any obvious problems with your code, but I didn't read
it carefully. The monop(1) program may be asking for something other
than what you're passing to it or visa versa. That's often the case
in these situations.

Here's (a mostly untested) class I was working on to talk to Kermit. I
don't know if it'll help you. It'll work for arbitrary shell commands,
though. It actually worked to connect another class to my HP48 via
RS232! At one point, and I passed data both ways (as far as I
remember). It has a thread to do reading/writing, and a thread to
perform a timeout (in case your chat gets stuck and the time slips
by). At any rate, this proves that Runtime.getRuntime().exec(command,
environment); works, at least for what I was trying to do.

Steve

import java.io.*;

/**
 * Class for executing a command at a shell.
 *
 * 
 *
 * @see java.lang.Process
 * @see SPException
 * @version $Id: ShellProcess.java,v 1.4 1998/05/19 10:00:29 stevemw Exp stevemw $
 * @author Stephen Wynne <[EMAIL PROTECTED]>
 *
 */

public class ShellProcess extends Thread {
private Writer outPut;
private String command[] = { "/bin/true" };
String environment[] = { "PATH=/bin:/usr/bin:/usr/X11R6/bin:." };
private int MAXWAIT_MILLIS =  60 * 1000;
private Process child;
private boolean done = false;

/**
 * Default constructor.
 */
ShellProcess() {
}

/**
 * Combined constructor initialization class.
 *
 * @param cmd  Command tokens to execute.
 */
ShellProcess(String cmd[]) {
command = cmd;
init(cmd, null, new OutputStreamWriter(System.out));
}

/**
 * Combined constructor initialization class.
 *
 * @param cmd  Command tokens to execute.
 * @param env  Environment.
 */
ShellProcess(String cmd[], String env[]) {
init(cmd, env, new OutputStreamWriter(System.out));
}

/**
 * Combined constructor initialization class.
 *
 * @param cmd  Command tokens to execute.
 * @param env  Environment.
 * @param out  Stream used to send results.
 */
ShellProcess(String cmd[], String env[], Writer out) {
init(cmd, env, out);
}

/**
 * Initialization code for all non-default constructors.
 * Also used to setup default-constructed object and get it running.
 *
 * @param cmd  Command tokens to execute.
 * @param env  Environment.
 * @param out  Stream used to send results.
 */
public void init(String cmd[], String env[], Writer out) {
command = cmd != null ? cmd : command;
environment = env != null ? env : environment;
outPut  = out != null ? out : new OutputStreamWriter(System.out);

start(); // Start doing some I/O

try {
join(MAXWAIT_MILLIS);
} catch(InterruptedException e) {
// XXX IGNORE INTERRUPTIONS
}

if (! done) {
setPriority(Thread.MIN_PRIORITY);
child.destroy();// Kill our Process (from exec).
interrupt();// Wake blocked threads.
}
}

/**
 * Executes a command at the shell.
 * @exception SPException.
 */
private void execute() throws SPException {
try {
child = Runtime.getRuntime().exec(command, environment);
BufferedReader in = new
BufferedReader(new InputStreamReader(child.getInputStream()));
String line;
while((line = in.readLine()) != null) {
outPut.write(line + "\n");
outPut.flush();
}
if (child.waitFor() != 0) {
// Command failed.
throw new SPException(child.exitValue());
}
} catch (Exception e) {
throw new SPException(e.toString());
}
return;
}

/**
 * Do the work.
 */
public void run() {
// Try to prevent the watch thread from starving. XXX necessary?
setPriority(currentThread().getPriority() - 1);
try {
execute();
} catch(SPException e) {
System.err.println("Caught exception " + e.toString() +
   ". Terminated.");
}
synchronized (this) {
done = true;
}
return;
}

/**
 * Access the current timeout value in seconds.
 */

Re: JClass or Swing

1998-06-17 Thread Alain Caron



Sze Yuen Wong wrotet:

> I'm trying to decide whether to use JClass or Swing on my project,
> any comment?
>
> Thanks,
>
> Sze Yuen

  I would go for Swing.  Since Swing is going to be a standard in Java
1.2, applets won't need to download Swing as they would have to do with
JClass.   Even now, with java plugin (aka Activator), it is more likely
that Swing will be on the user's local machine than JClass.  Besides, I
would still use Swing because it is (becoming) a standard, and it will
be easier to find a programmer who knows Swing than to find a programmer
who knows JClass.

Regards,

Alain Caron
[EMAIL PROTECTED]




Re: InetAddr.getLocalHost() [glibc?] bug workaround

1998-06-17 Thread Andreas Jaeger

> Geoffrey S Knauth writes:

Geoffrey> Joe Carter suggested:
>> Change the order of localhost and the real host name in /etc/hosts.
>> (real first!). The getlocalhost just seems to get the first it finds.

Geoffrey> I tried this straightforward workaround, as silly as it seemed, and
Geoffrey> the "GNU/Linux JDK InetAddr.getLocalHost() on glibc bug" vanished
Geoffrey> immediately.  I'm wondering why someone might have coded things this
Geoffrey> way, since ordinarily people don't change their /etc/hosts file every
Geoffrey> time they switch between interfaces (e.g., ppp0 at home, eth0 at
Geoffrey> work).  So I'd consider this a glic bug, unless it turns out the
Geoffrey> code in getlocalhost() has a reason behind it.

Geoffrey,

you mailed this to bug-glibc totally out of context.  If you think
it's a glibc bug, then please provide a real bug report (the best way
is to use the glibcbug script):
- What's your problem?
- How did you solve it?
- Which glibc version are you running?
- How can I reproduce it?
- What is the code in getlocalhost doing?
- ...

Please supply if possible a small C program showing the bug - trying
to fix a bug which might be in JDK, glibc or whatever might be
impossible.

Andreas
-- 
 Andreas Jaeger   [EMAIL PROTECTED][EMAIL PROTECTED]
  for pgp-key finger [EMAIL PROTECTED]




Re: Problems with SuperMojo - it is AWFUL

1998-06-17 Thread Kevin Hester

My comments on SuperMojo:

I tried it on Windows and Linux and it was AWFUL in both environments.  I
purchased it because Penumbra offered a 30 day free trial.  It was so bad
that I decided to return it the day after I received the CD.  To make a
long story short: I left voice mails and email with various Penumbra
mailboxes, all trying to get an RMA number.  After two weeks with no
response, I returned the package and told my credit card company to decline
the charge.

The worst support I've ever seen.  A really poor product.  Two great things
which go great together.

Kevin

At 10:29 PM 6/19/98 -0500, John Collins wrote:
>Has anyone gotten SuperMojo to work? I've got RedHat 5.0, jdk1.1.5v7.
>Lots of other Java stuff works. The two things that aren't working are
>SuperMojo (brand new, version 1.3) and Together/J (also brand new,
>version 2.0). In both, they start up and some things work, but I can't
>initiate a new project. SuperMojo puts up a 0X0 window that, when
>stretched out, is empty and unresponsive, and won't respond to window
>manager close requests. Together/J puts up a huge, undecorated window in
>a different virtual screen (below and to the right) from the one I'm
>working in. It also has no contents and is unresponsive.
>
>Any experiences or ideas? Thanks.
>
>John Collins
> 

-
S. Kevin Hester For PGP Public Key, see:
[EMAIL PROTECTED]   http://www.interstice.com/~kevinh
"Castigat ridendo mores" 





Need a Java/Linux RedHat 5.0 configuration where getLocalHost works

1998-06-17 Thread John A. Zinky


We have not been able to find a configuration of Linux Red Hat 5.0 and
jdk 1.1.x that works for the following one line test program.

public class TestGetLocalHost {
  public static void main(String[] args) {
try {
  System.out.println(java.net.InetAddress.getLocalHost());
} catch (Exception e) { e.printStackTrace(); }
  }}

The Test program prints the IP address of local host 
(A necessary function for servers that need to publish their location)

On Solaris,NT, and  Red Hat 4.0/jdk1.1.3 this works: e.g:
   guava.bbn.com/171.78.82.34
On Linux Red Hat 5.0 jdk1.1.5 this returns the loopback address: e.g:
   localhost/127.0.0.1

We have traced the problem in to the C routines for native platform
on Line 298 in .../jdk1.1.5/src/java/net/InetAddress.java
localHost.hostName = impl.getLocalHostName();
System.out.println("local host name: " + localHost.hostName);

On linux: local host name: localhost
On Solaris:   local host name: guava.bbn.com

 Questions *
1) Does anyone have a Linux RedHat 5.0 configuration where this program works?

a) jdk1.1.3 does not work under RedHat 5.0 because it uses libc and not glibc
   Is there a way to shimmy in libc just for this one java executable?

b) We have tried several version of jdk1.1.5 and jdk1.1.6, 
   all of which we had a hard time installing.

c) How about a statically linked version of jdk1.1.x?

2) Could this be a configuration error in the linux host?

3) Could we hack the C source for impl.getLocalHostName?
 a) Where is the source code?
 b) Where is the Make?

4) Could this be a security feature?
 The news groups has lots of chatter on why getLocalHosts should not
 give the IP address IN THE CASE OF APPLETS.
 But this case, we have a SERVER, so it needs to get it's own address.

thanks
zinky




Re: java.lang.UnsatisfiedLinkError: readImage

1998-06-17 Thread Klaus Strebel

Hi everybody,

well, maybe i'm a bastard, but i had the same problem some months ago,
when i tried Steve's JDK1.1.3 Port with tya, no Valetta, one unsatisfied
link. My solution to this problem was quite radical. First in unzipped
the classes.zip, then i decompiled the .class-file, which is loading the
libjpeg, i renamed it in the loadlib to libJDKjpeg, recompiled the class
and jared the whole thing to a classes.jar. This classes.jar i'm using
in stead of the classes.zip im my CLASSPATH. At last, i renamed the
libjpeg.so to libJDKjpeg.so i the JDK-lib dir and that's all.

In my opinion, the developers of shared libs should try to name thy
product's in a unique manner, to avoid such naming problems. Though it's
up to the sunny people, perhaps Steve (cheers to Steve, applause
applause!) could start this for java-linux? I will place this to JDC.

PS: Karl, it's great that [EMAIL PROTECTED] is back. Thanks!

PPS: Piss off, spammers, EMAIL MARKETING SUCKS !!! ((:{

Ciao
Klaus


Klaus Strebel   _/_/_/_/_/_/_/_/_/_/_/
EIGNER + PARTNER AG_/_/
Ruschgraben 133   _/_/
D-76139 Karlsruhe_/_/_/_/_/_/_/_/_/_/_/
Phone:  +49 (721) 6291 - 0  _/  _/
Fax:+49 (721) 6291 - 88_/  _/
Mobile: +49 (172) 764 396 6   _/_/_/_/_/_/_/
E-Mail: [EMAIL PROTECTED]




JDK 1.1.* bug?!

1998-06-17 Thread Maxim Kizub

Hello.

My name is Maxim, and I'm a developer of Kiev compiler for java.
While developing the compiler I've found a strange bug -
JVM can't find an interface method. But it's there! I can see
it by javap. Also, jdk1.2 executes the same code. Of course,
I run it with -verify switch - but it does not find any errors
in classes

To find out the bug I need jvm sources, but Sun does not
distribute sources to countries, that are unlisted in
their source-request page, namely in Ukraine.
They also do not respond on my bug submition - I can't
to find it in Bug Parade, and can't figure out the status
and the way to generate .class files to avoid error.

Please, can you check it - is it a JVM bug or not? And
what's wrong with jdk1.1 ? Should I sort methods
in .class file or any other ways to pass it...

Please, if possible, download ver.0.04 of compiler
from http://ukraine.org/kiev/download.html
and help me find out the bug.

I have a new version of compiler with overloadable and
user-defined operators, but I can't put it to Internet,
until I'll fix the bug :-(




Need a Java/Linux RedHat 5.0 configuration where getLocalHost works

1998-06-17 Thread Geoffrey S. Knauth

Does anyone out there on the blackdown list have knowledge of this
bug/feature?

Geoffrey S. Knauth   http://world.std.com/~gsk

> From: "John A. Zinky" <[EMAIL PROTECTED]>

We have not been able to find a configuration of Linux Red Hat 5.0 and
jdk 1.1.x that works for the following one line test program.

public class TestGetLocalHost {
  public static void main(String[] args) {
try {
  System.out.println(java.net.InetAddress.getLocalHost());
} catch (Exception e) { e.printStackTrace(); }
  }}

The Test program prints the IP address of local host 
(A necessary function for servers that need to publish their location)

On Solaris,NT, and  Red Hat 4.0/jdk1.1.3 this works: e.g:
   guava.bbn.com/191.79.84.43
On Linux Red Hat 5.0 jdk1.1.5 this returns the loopback address: e.g:
   localhost/127.0.0.1

We have traced the problem in to the C routines for native platform
on Line 298 in .../jdk1.1.5/src/java/net/InetAddress.java
localHost.hostName = impl.getLocalHostName();
System.out.println("local host name: " + localHost.hostName);

On linux: local host name: localhost
On Solaris:   local host name: guava.bbn.com

 Questions *
1) Does anyone have a Linux RedHat 5.0 configuration where this program works?

a) jdk1.1.3 does not work under RedHat 5.0 because it uses libc and not glibc
   Is there a way to shimmy in libc just for this one java executable?

b) We have tried several version of jdk1.1.5 and jdk1.1.6, 
   all of which we had a hard time installing.

c) How about a statically linked version of jdk1.1.x?

2) Could this be a configuration error in the linux host?

3) Could we hack the C source for impl.getLocalHostName?
 a) Where is the source code?
 b) Where is the Make?

4) Could this be a security feature?
 The news groups has lots of chatter on why getLocalHosts should not
 give the IP address IN THE CASE OF APPLETS.
 But this case, we have a SERVER, so it needs to get it's own address.

thanks
zinky




More problems extending an inner class

1998-06-17 Thread Daniele Lugli

Marcus,
I've tried to modify my code a little bit, hoping to keep the possibility
to extend the inner class. The idea is: avoid having Dialog1 implementing
ActionListener; give him instead a member function which does everything
actionPerformed should do, but which has a different name, say
myActionPerformed to be original. Then implement ActionListener in the
descendant Dialog2, and call myActionPerformed in its actionPerformed (I
see that it looks a little bit involved, but it's easier to do than to say.
Just see the source hereinafter).
The behaviour changed, but it is still not understandable to me. Neither of
the two System.out.println appears to be executed. Am I doing something
very stupid?

By the way, I sent my previous message both to java-linux and to you,
[EMAIL PROTECTED], but your copy returned back with an error.

Best regards, Daniele



// File name: Test.java

import java.awt.*;
import java.awt.event.*;
import java.lang.String;
import java.text.*;
import java.util.*;

public class Test extends Frame {

  public static void main (String args[]) throws Exception {
new Test ();
  }

  public Test () throws Exception {
super ();
setBounds (300, 100, 300, 100);
setVisible (true);

i = 5;

new Dialog2 (this);
  }

  private void quit () {
setVisible (false);
dispose ();
System.exit (0);
  }


  class Dialog1 extends Dialog {
Dialog1 (Frame parent) {
  super (parent, "Dialog", true );
  setBounds (400, 200, 100, 75);
  okButton = new Button ("OK");
  add (okButton);
  setVisible (true);
}
public void myActionPerformed (ActionEvent aevt) {
  
  System.out.println ("Dialog1: i=" + i);

}
public Button okButton;
  }

  class Dialog2 extends Dialog1 implements ActionListener {
Dialog2 (Frame parent) {
  super (parent);
  okButton.addActionListener (this);
}
public void actionPerformed (ActionEvent aevt) {
  super.myActionPerformed (aevt);
  
  System.out.println ("Dialog2: i=" + i);

  quit ();
}
  }

  int i;

}




TextArea bug ?

1998-06-17 Thread Steffen Tacke

Hi !

I'm not sure but i think there's a bug in the TextArea Class provided with
the Linux JDK 1.1.6v1 (also in 1.1.5vX).
If i put a simple TextArea in a Dialog Window an fill it with some Text
with the append() (or the old appendText()) -Method I always get a
Segmentation Violation when i try to dispose the Dialog:
SIGSEGV   11*  segmentation violation
(+ complete thread dump and core file)
Any ideas ?

(running JDK on Suse Linux 5.1)
--
mfg. 
Steffen Tacke

*
** | *** Wilhelm-Schickardt-Insitut fuer Informatik  Tuebingen, Sand 13 ** **
** | ***email [EMAIL PROTECTED]** **
** | ***  [EMAIL PROTECTED] ** **
** | ***Member #402 of TeamOS/2 Germany ** **
** | *** HOMEPAGE: http://www-ti.informatik.uni-tuebingen.de/~tacke ** **
** | ***   ...  ** **
** | ***`:::'  ...  ..  ** **
** | *** :::  *  `::.::'** **
** | *** ::: .::  .:.::.  .:: .::  `::. :'  ** **
** | *** :::  ::   ::  ::  ::  :::::.   ** **
** | *** ::: .::. .::  ::.  `. .:'  ::. ** **
** | ***   ..:::.::'   ..   ** **
*





Re: Need a Java/Linux RedHat 5.0 configuration where getLocalHost works

1998-06-17 Thread Per Widerlund

[EMAIL PROTECTED] wrote:
> I'll bet that the first line in your /etc/hosts is:
> 
> 127.0.0.1   localhost localhost.localdomain
> 
> At least, that's the way it was with mine and, when I tried your program, I
> got the same "broken" answer you got.  After reading Per's message, I moved
> that line below the second line in my /etc/hosts so that it looks like this:
> 
> 198.41.2.245knight.internic.net knight
> 127.0.0.1   localhost localhost.localdomain
> 
> Guess what?  It now works correctly.  I have a feeling that it shouldn't be
> dependent on your /etc/hosts entry order, but at least this will account for
> the difference between your and Per's results.
> 
> BTW, I'm testing this on a RH 5.1 system with sn's jdk-1.1.6v1.2.

My (that is me Per) /etc/hosts file has localhost as the first line,
but I have DNS configured and I think that is what made the difference
for me. I vaguely remember having a similar problem with the 
'hostname' command - it kept resulting in "localhost" until I changed
my hosts file.. Anyway, the problem is most likely not Java related.

/Per Widerlund




javac says out of memory

1998-06-17 Thread Moslehi, Farhood

Hi all;

After installing jdk1.1.5v7 on Redhat 5.0, javac gives me a outof memory
message. So I checked my memory with the command free and foundout that my
swap space reading gives me three zeros. I guess this means it is off, so I
use the command swapon -a to turn the swap space on but after I issue free
again, I get three zeros.

Can anyone help with this swap space problem under RH5.0, since this will
probably fix the out of memory problem for jdk1.1.5.

Thanks in advance





JClass or Swing

1998-06-17 Thread Sze Yuen Wong

I'm trying to decide whether to use JClass or Swing on my project,
any comment?

Thanks,

Sze Yuen





Re: Free Builder?

1998-06-17 Thread Yan Huang

Hi, there,

At Wed, 17 Jun 1998 11:24:42 -0400
Sze Yuen Wong <[EMAIL PROTECTED]> wrote:

  > Anyone knows any news about Free Builder?
  > Is the version which support 1.1 and Swing out there yet?
  > 
  > Thanks,

Currently, FreeBuilder is in Version 0.7.1 and reportedly support
JDK1.1.5  and Swing 1.0.1. I have tried it on Linux jdk1.1.5. However, 
it can not come up under Linux jdk1.1.6-v2_test.

---yan




Re: Free Builder?

1998-06-17 Thread Tom Sedge

On Wed, 17 Jun 1998, Sze Yuen Wong wrote:

> Where can I get it? Is it stable enough to actually program in it?

I haven't used it, but the home page is:

http://members.xoom.com/ivelin/FreeBuilder/fb.html


Tom.
--
Lunatech Research.  Where the impossible happens every day...




which jdk

1998-06-17 Thread Brad Giaccio

Now this may seem like a silly question but I didn't really see a firm
answer in the FAQ so I'll ask.  It seems that there are two different
prots of jdk going on one by Steve Byrne's and the other by Sergey
Nikitin.

Now I'm sure these are both functional but I'm wondering who's port I
should be using or what the differences are.  If anyone would care to
clear this up for me it would be much appreciated.

Thanks,
Brad



--- There are two kinds of knowledge, you either know the answer or
you know where to find it
  -Kane, Johnson, and anonymous




Re: Free Builder?

1998-06-17 Thread Yan Huang

At Wed, 17 Jun 1998 12:24:55 -0400
Sze Yuen Wong <[EMAIL PROTECTED]> wrote:

  > > Currently, FreeBuilder is in Version 0.7.1 and reportedly support
  > > JDK1.1.5  and Swing 1.0.1. I have tried it on Linux jdk1.1.5. However,
  > > it can not come up under Linux jdk1.1.6-v2_test.
  > >
  > > ---yan
  > 
  > Where can I get it? Is it stable enough to actually program in it?

Check out the latest volume of http://www.javaworld.com/. There is a
introduction about FB over there.

---yan




Re: More problems extending an inner class

1998-06-17 Thread Robert Fitzsimons

Daniele

Here is some code I put together showing the three forms of inner
classes, this may help you understand what is going wrong.  I also
think your code didn't work because the was a logical error, with
the events somewhere.

Robert Fitzsimons
[EMAIL PROTECTED]

// Test.java

import java.awt.*;
import java.awt.event.*;

public class Test extends Frame {
private Checkbox cb;

public Test() {
Button b;
this.setLayout(new FlowLayout());
this.setSize(200, 200);
// Anonymous innerclass
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
// Local innerclass
class ActionAdapter implements ActionListener {
public void actionPerformed(ActionEvent e) {
TestDialog td;
if(!Test.this.cb.getState()) {
td = new TestDialog(Test.this,
e.getActionCommand());
} else {
td = new ExTestDialog(Test.this,
e.getActionCommand());
}
td.setVisible(true);
}
}
ActionAdapter aa = new ActionAdapter();
for(int i = 1; i < 6; i++) {
this.add(b = new Button("Test " + i));
b.addActionListener(aa);
}
this.add(cb = new Checkbox("Modal"));
this.setVisible(true);
}

public static void main(String[] args) {
new Test();
}

// Innerclass
protected class TestDialog extends Dialog {
public TestDialog(Frame frame, String title) {
super(frame, title);
this.setSize(100, 100);
// Anonymous innerclass
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
TestDialog.this.dispose();
}
});
}
}

// Extended innerclass
protected class ExTestDialog extends TestDialog {
public ExTestDialog(Frame frame, String title) {
super(frame, title);
this.setModal(true);
}
}
}




Re: More problems extending an inner class

1998-06-17 Thread Robert Fitzsimons

Daniele

Here is some code I put together showing the three forms of inner
classes, this may help you understand what is going wrong.  I also
think your code didn't work because the was a logical error, with
the events somewhere.

Robert Fitzsimons
[EMAIL PROTECTED]

// Test.java

import java.awt.*;
import java.awt.event.*;

public class Test extends Frame {
private Checkbox cb;

public Test() {
Button b;
this.setLayout(new FlowLayout());
this.setSize(200, 200);
// Anonymous innerclass
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
// Local innerclass
class ActionAdapter implements ActionListener {
public void actionPerformed(ActionEvent e) {
TestDialog td;
if(!Test.this.cb.getState()) {
td = new TestDialog(Test.this,
e.getActionCommand());
} else {
td = new ExTestDialog(Test.this,
e.getActionCommand());
}
td.setVisible(true);
}
}
ActionAdapter aa = new ActionAdapter();
for(int i = 1; i < 6; i++) {
this.add(b = new Button("Test " + i));
b.addActionListener(aa);
}
this.add(cb = new Checkbox("Modal"));
this.setVisible(true);
}

public static void main(String[] args) {
new Test();
}

// Innerclass
protected class TestDialog extends Dialog {
public TestDialog(Frame frame, String title) {
super(frame, title);
this.setSize(100, 100);
// Anonymous innerclass
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
TestDialog.this.dispose();
}
});
}
}

// Extended innerclass
protected class ExTestDialog extends TestDialog {
public ExTestDialog(Frame frame, String title) {
super(frame, title);
this.setModal(true);
}
}
}




PLEASE help! Java Web Server 1.1

1998-06-17 Thread Richard Hakim

Hi -

I guess you're all probably really tired of people asking for help with
this, but...

I'm trying to get the Java Web Server 1.1 running.  I'm trying to follow
the directions on java-linux.org, but am having trouble.  I've got the
Solaris version, and I've got jwebs-linux.diff, but when I ran it
through patch it bailed with errors.  So then I tried applying the patch
by hand, but clearly I did something wrong because my Makefile.lnx
wouldn't do anything, and it was too complicated for me to figure out.

Can anyone help me??  Please??

I'm running RH5.1, so if there's a working Java Web Server RPM that'd be
awesome.  Or even a tarball of a working installation would be great. 
If not, if _anyone_ could offer to help me out that'd be great.

Many thanks,

Richard




PLEASE help! Java Web Server 1.1

1998-06-17 Thread Richard Hakim

Hi -

I guess you're all probably really tired of people asking for help with
this, but...

I'm trying to get the Java Web Server 1.1 running.  I'm trying to follow
the directions on java-linux.org, but am having trouble.  I've got the
Solaris version, and I've got jwebs-linux.diff, but when I ran it
through patch it bailed with errors.  So then I tried applying the patch
by hand, but clearly I did something wrong because my Makefile.lnx
wouldn't do anything, and it was too complicated for me to figure out.

Can anyone help me??  Please??

I'm running RH5.1, so if there's a working Java Web Server RPM that'd be
awesome.  Or even a tarball of a working installation would be great. 
If not, if _anyone_ could offer to help me out that'd be great.

Many thanks,

Richard




Java and C interaction via stdin/stdout

1998-06-17 Thread Richard Hall

I'd like to create a Java GUI for the monopoly game in the bsdgames
package, but I am having trouble getting the Java program to connect to
the C program.  Runtime.getRuntime().exec("/usr/games/monop"); works just
fine, but Process.getInputStream() doesn't seem to work.

Has anyone succeeded at getting a Java program to interact with a C
program via stdin/stdout?  If so, how?  If not, can you explain the
behavior of the following code?  (JDK 1.1.6 and Debian 2.0 libc5, i386)

import java.io.*;
import java.awt.*;

public class Monopoly extends Thread {
  private InputStream in;
  private BufferedWriter out;
  private Process game = null;

  public Monopoly() {
try {
  game = Runtime.getRuntime().exec("/usr/games/monop");
  in = game.getInputStream();
  out = new BufferedWriter(new
OutputStreamWriter(game.getOutputStream()));
  System.out.println(in.available());
}
catch(IOException e) { System.err.println("Program not started"); }
  }

  public static void main(String args[]) {
Monopoly f = new Monopoly();
System.out.println("ready to begin");
f.start();
  }

  public void run() {
InputStreamReader ir = new InputStreamReader(in);
int count = 0;
try {
  while(!(ir.ready())) {
this.yield();
this.sleep(500);
if(count++ > 10) break;
  }
  System.out.println(ir.ready());
  out.write('\n');
  System.out.println(ir.ready());
  out.newLine();
  out.flush();
  System.out.println(ir.ready());
  out.write('3');
  out.newLine();
  System.out.println(ir.ready());
  System.out.println(ir.read());
}
catch(IOException e2) {}
catch(InterruptedException ex) {}
finally { System.out.println("done"); }
  }
}


bash$ /usr/local/jdk1.1.6/bin/java Monopoly
0
ready to begin
false
false
false
false

The program hangs indefinitely here.  Thanks for your time.

Richard Hall
Network Services
University of Tennessee




Free Builder?

1998-06-17 Thread Sze Yuen Wong

Anyone knows any news about Free Builder?
Is the version which support 1.1 and Swing out there yet?

Thanks,

Sze Yuen





out of memory

1998-06-17 Thread Richard Hall

I've just begun using JDK1.1.6 on my Debian 2.0.29 machine, and the
compiler often, but not always claims to be out of memory.  top says:

Mem:   14324K av,  14020K used,304K free,   8732K shrd, 92K buff
Swap:  32252K av,  17908K used,  14344K free  3616K cached

The compiler has bailed with close to 1M of RAM free.  The only things
running while this is happening besides a few xterms are X, Netscape, and
XEmacs.  Do I need to add more swap or what?

Richard Hall
Network Services
University of Tennessee