Re: Thread in the Linux's JVM

1999-11-09 Thread Nathan Meyers

> Evandro Luquini wrote:
> 
> Hi,
> If the Linux JVM works with green and natives threads, How will I
> specify what model I want ?

Either set an environment variable:

export THREADS_FLAG=green
or
export THREADS_FLAG=native

or specify on the java launch command line:

java -green ...
 or
java -native ...

If you're running JDK1.1.7, you need to be sure to obtain the additional
download with the native-threaded versions of the executables and
libraries.

Nathan



> -Original Message-
> From: Nathan Meyers [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 08, 1999 10:14 PM
> To: [EMAIL PROTECTED]
> Cc: Evandro Luquini; [EMAIL PROTECTED]
> Subject: Re: Thread in the Linux's JVM
> 
> Jacob Nikom wrote:
> 
> > It would be nice to know more about multithreading features of Linux
> 
> > JVM.
> 
> There are two threading models. If you run with green threads, there
> is
> no preemption, and control passes between threads either with yield()
> calls or possibly with other calls that can block (such as sleep() and
> 
> various I/O calls).
> 
> If you run with native threads, the JVM is using the system's pthread
> API, which (except for very strangely configured systems) means it's
> using kernel threads. They give you preemption but not thread
> priorities, and there is no guarantee about the size of the time
> slices,
> when preemption occurs, or how thread execution is distributed across
> multiple processors.
> 
> It sounds from your description like you're relying on preemption.
> Unfortunately, that's a bad thing - Java doesn't guarantee that you'll
> 
> get it, and you need to code as if preemption will not happen.
> SwingWorker is a nice tool for conveniently launching another thread,
> but it doesn't magically turn non-preemptive threads into preemptive
> threads.
> 
> So to your problem... why did the behavior change when you rewrote
> some
> of your Java methods as native methods? My guess is that you were
> using
> some Java methods that do voluntary yields, and you stopped using them
> 
> when you rewrote the code as native methods.
> 
> BTW, that Sun article mentioned in Evandro's original mail (below)
> discusses why Solaris is a good platform for applications that rely on
> 
> preemptive multi-threading. But it's a Solaris marketing article, not
> a
> Java programming guide. The Java portability message is very clear:
> don't rely on preemption.
> 
> Nathan
> 
> >
> > Hi,
> >
> > Thank you for bringing up this question. I also have problems with
> > multiple threads in Linux. In my case the behavior of threads with
> > JNI is different from pure Java behavior.
> >
> > I use SwingWorker class. If I don't have JNI methods I don't have
> > to use yield() method. If I replace my Java methods with JNI calls
> > I must use yield(), otherwise the application simply does not work.
> > There is no mentioning of yield() method in any SwingWorker-related
> > documentation.
> >
> > It would be nice to know more about multithreading features of Linux
> 
> > JVM.
> >
> > Jacob Nikom
> >
> > > Evandro Luquini wrote:
> > >
> > > Hi,
> > > In the JavaWord article called "programming Java threads in the
> real
> > > world, Part 1(
> > > http://www.javaworld.com/jw-09-1998/jw-09-threads.html)", the
> author
> > > sad that "Java's promise of platform independence falls flat on
> its
> > > face in the threads arena". If you read this paper you will can
> see
> > > two plataform example : NT and Solaris.
> > >
> > > Major question is what scheduling is implemented by the Linux JVM
> and
> > > the Linux OS. Does it use a nonpreemptive our preemptive scheduler
> ?
> > >
> > > The other important question is about what thread's architecture
> is
> > > implement by Linux O.S. I am asking it because in the sun's paper
> > > "Multithreading: General And Java-Specific Information
> > >
> 
>(http://www.sun.com/solaris/java/wp-java/4.html;$sessionid$5CBVN2YAAI4VTAMW0JZE3NUBS1JHEUDO)"
> 
> > > sad : "Understanding the architectural advantages of one native MT
> 
> > > environment/architecture over another is critical to an
> understanding
> > > of the advantages of one Java implementation over another. Since a
> 
> > > typical JVM runtime is implemented on top of the traditional
> platform,
> > > a richer, architecturally superior MT platform will obviously
> > > translate to a superior Java MT environment for Java applications
> on
> > > that platform. The native OS threads model greatly influences Java
> 
> > > application performance."
> > >
> > > Thanks
> >
> >
> --
> 
> > To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



cut & paste

1999-11-09 Thread Edwin Park

Hi,

I'm trying to cut & paste string selections in Java on Linux, and am
running into some problems.  Cut & paste works fine between Java
applications that pass DataFlavor.stringFlavor types, but when I try to
cut & paste between non-Java applications and Java, the Transferrable is
of type sun.awt.motif.X11Selection, and calling getTransferDataFlavors()
on the transferrable returns null - i.e. there is no way to get data
from the transferrable selection.  The same code works fine under
Windows - selections there are instances of
java.awt.datatransfer.StringSelection, and they support both
DataFlavor.stringFlavor and DataFlavor.plainTextFlavor.  Can anyone tell
me why this is happening?

Here's a code snippet:

Toolkit tk = Toolkit.getDefaultToolkit();
Clipboard clipboard = tk.getSystemClipboard();
Transferable trans = clipboard.getContents(this);
DataFlavor flavors[] = trans.getTransferDataFlavors();  // returns null
under Linux jdk1.2 pre-v2
Object data = trans.getTransferData(DataFlavor.stringFlavor);  //
java.io.IOException: could not get transfer data at
sun.awt.motif.X11Selection.getTransferData(X11Selection.java:273)

Thanks,
Edwin


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Swing with ibm jdk 1.1.8

1999-11-09 Thread Pere Serra

I've downloaded ibm jdk 1.1.8 and it works with text mode programs, but when I
try to run a swing application it doesn't work. I put the file rt.jar in the
classpath then java says Class not found: java.lang.System.

Does anyone know what am I doing wrong ?

Thanks a lot

--
-
(,   http://www.geocities.com/Hollywood/Set/8660
/|__--__
|\ '__
`.' / `.,_ _
/  ||``._.'
  .'   /|Pere Joan Serra Caldentey
.'/\ \
` `,/ /`,\  [EMAIL PROTECTED]
   .'.'  /|
,' /   / |
- `- -- `-'- ---


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Thread in the Linux's JVM

1999-11-09 Thread Jacob Nikom

So, you think that JNI does not represent any specific issues in
Java multithreading? Does the JNI/C code executes in the same thread
as the Java method which invoked it?

Also, what about event-dispatching thread? In the documentation about 
InvokeLater() method there is no any mention that you have to change
the non-event-dispatching thread's priority in order to allow the
event-dispatching thread get called. Is it simply assumed? This is
strange.

Jacob Nikom

Nathan Meyers wrote:
> 
> Jacob Nikom wrote:
> 
> > It would be nice to know more about multithreading features of Linux
> > JVM.
> 
> There are two threading models. If you run with green threads, there is
> no preemption, and control passes between threads either with yield()
> calls or possibly with other calls that can block (such as sleep() and
> various I/O calls).
> 
> If you run with native threads, the JVM is using the system's pthread
> API, which (except for very strangely configured systems) means it's
> using kernel threads. They give you preemption but not thread
> priorities, and there is no guarantee about the size of the time slices,
> when preemption occurs, or how thread execution is distributed across
> multiple processors.
> 
> It sounds from your description like you're relying on preemption.
> Unfortunately, that's a bad thing - Java doesn't guarantee that you'll
> get it, and you need to code as if preemption will not happen.
> SwingWorker is a nice tool for conveniently launching another thread,
> but it doesn't magically turn non-preemptive threads into preemptive
> threads.
> 
> So to your problem... why did the behavior change when you rewrote some
> of your Java methods as native methods? My guess is that you were using
> some Java methods that do voluntary yields, and you stopped using them
> when you rewrote the code as native methods.
> 
> BTW, that Sun article mentioned in Evandro's original mail (below)
> discusses why Solaris is a good platform for applications that rely on
> preemptive multi-threading. But it's a Solaris marketing article, not a
> Java programming guide. The Java portability message is very clear:
> don't rely on preemption.
> 
> Nathan
> 
> >
> > Hi,
> >
> > Thank you for bringing up this question. I also have problems with
> > multiple threads in Linux. In my case the behavior of threads with
> > JNI is different from pure Java behavior.
> >
> > I use SwingWorker class. If I don't have JNI methods I don't have
> > to use yield() method. If I replace my Java methods with JNI calls
> > I must use yield(), otherwise the application simply does not work.
> > There is no mentioning of yield() method in any SwingWorker-related
> > documentation.
> >
> > It would be nice to know more about multithreading features of Linux
> > JVM.
> >
> > Jacob Nikom
> >
> > > Evandro Luquini wrote:
> > >
> > > Hi,
> > > In the JavaWord article called "programming Java threads in the real
> > > world, Part 1(
> > > http://www.javaworld.com/jw-09-1998/jw-09-threads.html)", the author
> > > sad that "Java's promise of platform independence falls flat on its
> > > face in the threads arena". If you read this paper you will can see
> > > two plataform example : NT and Solaris.
> > >
> > > Major question is what scheduling is implemented by the Linux JVM and
> > > the Linux OS. Does it use a nonpreemptive our preemptive scheduler ?
> > >
> > > The other important question is about what thread's architecture is
> > > implement by Linux O.S. I am asking it because in the sun's paper
> > > "Multithreading: General And Java-Specific Information
> > > 
>(http://www.sun.com/solaris/java/wp-java/4.html;$sessionid$5CBVN2YAAI4VTAMW0JZE3NUBS1JHEUDO)"
> > > sad : "Understanding the architectural advantages of one native MT
> > > environment/architecture over another is critical to an understanding
> > > of the advantages of one Java implementation over another. Since a
> > > typical JVM runtime is implemented on top of the traditional platform,
> > > a richer, architecturally superior MT platform will obviously
> > > translate to a superior Java MT environment for Java applications on
> > > that platform. The native OS threads model greatly influences Java
> > > application performance."
> > >
> > > Thanks
> >
> > --
> > To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Thread in the Linux's JVM

1999-11-09 Thread Nathan Meyers

Jacob Nikom wrote:
> 
> So, you think that JNI does not represent any specific issues in
> Java multithreading? Does the JNI/C code executes in the same thread
> as the Java method which invoked it?

JNI code is just the native "back end" of certain Java methods. It runs
in whatever thread the caller is running in. The only specific issue I
know of is that it's probably easier to hog the CPU in native code than
in Java code.


> Also, what about event-dispatching thread? In the documentation about
> InvokeLater() method there is no any mention that you have to change
> the non-event-dispatching thread's priority in order to allow the
> event-dispatching thread get called. Is it simply assumed? This is
> strange.

This isn't about thread priorities. In a non-preemptive threading
environment, if one thread is hogging the CPU and never yielding, the
other threads will not get to run regardless of priority. InvokeLater
schedules some code to be run in a different thread (the event
dispatching thread), but doesn't guarantee that that thread will get any
time. You still have to avoid hogging the CPU in all threads.

Nathan


> 
> Jacob Nikom
> 
> Nathan Meyers wrote:
> >
> > Jacob Nikom wrote:
> >
> > > It would be nice to know more about multithreading features of Linux
> > > JVM.
> >
> > There are two threading models. If you run with green threads, there is
> > no preemption, and control passes between threads either with yield()
> > calls or possibly with other calls that can block (such as sleep() and
> > various I/O calls).
> >
> > If you run with native threads, the JVM is using the system's pthread
> > API, which (except for very strangely configured systems) means it's
> > using kernel threads. They give you preemption but not thread
> > priorities, and there is no guarantee about the size of the time slices,
> > when preemption occurs, or how thread execution is distributed across
> > multiple processors.
> >
> > It sounds from your description like you're relying on preemption.
> > Unfortunately, that's a bad thing - Java doesn't guarantee that you'll
> > get it, and you need to code as if preemption will not happen.
> > SwingWorker is a nice tool for conveniently launching another thread,
> > but it doesn't magically turn non-preemptive threads into preemptive
> > threads.
> >
> > So to your problem... why did the behavior change when you rewrote some
> > of your Java methods as native methods? My guess is that you were using
> > some Java methods that do voluntary yields, and you stopped using them
> > when you rewrote the code as native methods.
> >
> > BTW, that Sun article mentioned in Evandro's original mail (below)
> > discusses why Solaris is a good platform for applications that rely on
> > preemptive multi-threading. But it's a Solaris marketing article, not a
> > Java programming guide. The Java portability message is very clear:
> > don't rely on preemption.
> >
> > Nathan
> >
> > >
> > > Hi,
> > >
> > > Thank you for bringing up this question. I also have problems with
> > > multiple threads in Linux. In my case the behavior of threads with
> > > JNI is different from pure Java behavior.
> > >
> > > I use SwingWorker class. If I don't have JNI methods I don't have
> > > to use yield() method. If I replace my Java methods with JNI calls
> > > I must use yield(), otherwise the application simply does not work.
> > > There is no mentioning of yield() method in any SwingWorker-related
> > > documentation.
> > >
> > > It would be nice to know more about multithreading features of Linux
> > > JVM.
> > >
> > > Jacob Nikom
> > >
> > > > Evandro Luquini wrote:
> > > >
> > > > Hi,
> > > > In the JavaWord article called "programming Java threads in the real
> > > > world, Part 1(
> > > > http://www.javaworld.com/jw-09-1998/jw-09-threads.html)", the author
> > > > sad that "Java's promise of platform independence falls flat on its
> > > > face in the threads arena". If you read this paper you will can see
> > > > two plataform example : NT and Solaris.
> > > >
> > > > Major question is what scheduling is implemented by the Linux JVM and
> > > > the Linux OS. Does it use a nonpreemptive our preemptive scheduler ?
> > > >
> > > > The other important question is about what thread's architecture is
> > > > implement by Linux O.S. I am asking it because in the sun's paper
> > > > "Multithreading: General And Java-Specific Information
> > > > 
>(http://www.sun.com/solaris/java/wp-java/4.html;$sessionid$5CBVN2YAAI4VTAMW0JZE3NUBS1JHEUDO)"
> > > > sad : "Understanding the architectural advantages of one native MT
> > > > environment/architecture over another is critical to an understanding
> > > > of the advantages of one Java implementation over another. Since a
> > > > typical JVM runtime is implemented on top of the traditional platform,
> > > > a richer, architecturally superior MT platform will obviously
> > > > translate to a superior Java MT environment for Java applications on
> > > > that platform. 

Re: Swing with ibm jdk 1.1.8

1999-11-09 Thread Peter Graves

Try putting swingall.jar in your CLASSPATH, rather than rt.jar.

Works for me.

-Peter

Pere Serra wrote:
> 
> I've downloaded ibm jdk 1.1.8 and it works with text mode programs, but when I
> try to run a swing application it doesn't work. I put the file rt.jar in the
> classpath then java says Class not found: java.lang.System.
> 
> Does anyone know what am I doing wrong ?
> 
> Thanks a lot
> 
> --
> -
> 
> (,   http://www.geocities.com/Hollywood/Set/8660
> 
> /|__--__
> 
> |\ '__
> 
> `.' / `.,_ _
> 
> /  ||``._.'
> 
>   .'   /|Pere Joan Serra Caldentey
> 
> .'/\ \
> 
> ` `,/ /`,\  [EMAIL PROTECTED]
> 
>.'.'  /|
> 
> ,' /   / |
> 
> - `- -- `-'- ---
> 
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Thread in the Linux's JVM

1999-11-09 Thread Brett Smith

The JNI/C code DOES execute in the same thread as the Java thread that
invokes it.  You must consider this in your design.  Also, you can't
have a "non-Java" thread perform a call-back to a Java object.

Brett Smith


 Subject:
Re: Thread in the Linux's JVM
   Date:
Tue, 09 Nov 1999 12:23:35 -0500
   From:
Jacob Nikom <[EMAIL PROTECTED]>
 To:
Nathan Meyers <[EMAIL PROTECTED]>
CC:
Evandro Luquini <[EMAIL PROTECTED]>,
[EMAIL PROTECTED]



So, you think that JNI does not represent any specific issues in
Java multithreading? Does the JNI/C code executes in the same thread
as the Java method which invoked it?

Also, what about event-dispatching thread? In the documentation about
InvokeLater() method there is no any mention that you have to change
the non-event-dispatching thread's priority in order to allow the
event-dispatching thread get called. Is it simply assumed? This is
strange.

Jacob Nikom

Nathan Meyers wrote:
>
> Jacob Nikom wrote:
>
> > It would be nice to know more about multithreading features of Linux

> > JVM.
>
> There are two threading models. If you run with green threads, there
is
> no preemption, and control passes between threads either with yield()
> calls or possibly with other calls that can block (such as sleep() and

> various I/O calls).
>
> If you run with native threads, the JVM is using the system's pthread
> API, which (except for very strangely configured systems) means it's
> using kernel threads. They give you preemption but not thread
> priorities, and there is no guarantee about the size of the time
slices,
> when preemption occurs, or how thread execution is distributed across
> multiple processors.
>
> It sounds from your description like you're relying on preemption.
> Unfortunately, that's a bad thing - Java doesn't guarantee that you'll

> get it, and you need to code as if preemption will not happen.
> SwingWorker is a nice tool for conveniently launching another thread,
> but it doesn't magically turn non-preemptive threads into preemptive
> threads.
>
> So to your problem... why did the behavior change when you rewrote
some
> of your Java methods as native methods? My guess is that you were
using
> some Java methods that do voluntary yields, and you stopped using them

> when you rewrote the code as native methods.
>
> BTW, that Sun article mentioned in Evandro's original mail (below)
> discusses why Solaris is a good platform for applications that rely on

> preemptive multi-threading. But it's a Solaris marketing article, not
a
> Java programming guide. The Java portability message is very clear:
> don't rely on preemption.
>
> Nathan
>
> >
> > Hi,
> >
> > Thank you for bringing up this question. I also have problems with
> > multiple threads in Linux. In my case the behavior of threads with
> > JNI is different from pure Java behavior.
> >
> > I use SwingWorker class. If I don't have JNI methods I don't have
> > to use yield() method. If I replace my Java methods with JNI calls
> > I must use yield(), otherwise the application simply does not work.
> > There is no mentioning of yield() method in any SwingWorker-related
> > documentation.
> >
> > It would be nice to know more about multithreading features of Linux

> > JVM.
> >
> > Jacob Nikom
> >
> > > Evandro Luquini wrote:
> > >
> > > Hi,
> > > In the JavaWord article called "programming Java threads in the
real
> > > world, Part 1(
> > > http://www.javaworld.com/jw-09-1998/jw-09-threads.html)", the
author
> > > sad that "Java's promise of platform independence falls flat on
its
> > > face in the threads arena". If you read this paper you will can
see
> > > two plataform example : NT and Solaris.
> > >
> > > Major question is what scheduling is implemented by the Linux JVM
and
> > > the Linux OS. Does it use a nonpreemptive our preemptive scheduler
?
> > >
> > > The other important question is about what thread's architecture
is
> > > implement by Linux O.S. I am asking it because in the sun's paper
> > > "Multithreading: General And Java-Specific Information
> > >
(http://www.sun.com/solaris/java/wp-java/4.html;$sessionid$5CBVN2YAAI4VTAMW0JZE3NUBS1JHEUDO)"

> > > sad : "Understanding the architectural advantages of one native MT

> > > environment/architecture over another is critical to an
understanding
> > > of the advantages of one Java implementation over another. Since a

> > > typical JVM runtime is implemented on top of the traditional
platform,
> > > a richer, architecturally superior MT platform will obviously
> > > translate to a superior Java MT environment for Java applications
on
> > > that platform. The native OS threads model greatly influences Java

> > > application performance."
> > >
> > > Thanks
> >





--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Swing with ibm jdk 1.1.8

1999-11-09 Thread Nathan Meyers

Pere Serra wrote:
> 
> I've downloaded ibm jdk 1.1.8 and it works with text mode programs, but when I
> try to run a swing application it doesn't work. I put the file rt.jar in the
> classpath then java says Class not found: java.lang.System.
> 
> Does anyone know what am I doing wrong ?

You're trying to use the JDK1.2 core class libraries with a JDK1.1 VM.

You need to get the 1.1 version of Swing from Sun; it's available from
http://java.sun.com.

Nathan


> Thanks a lot
> 
> --
> -
> (,   http://www.geocities.com/Hollywood/Set/8660
> /|__--__
> |\ '__
> `.' / `.,_ _
> /  ||``._.'
>   .'   /|Pere Joan Serra Caldentey
> .'/\ \
> ` `,/ /`,\  [EMAIL PROTECTED]
>.'.'  /|
> ,' /   / |
> - `- -- `-'- ---
> 
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Speed of IBM's Linux JDK

1999-11-09 Thread Jesper Nordenberg

> Quick question: the IBM JDK has shown *very* impressive benchmark results.
> Now, in light of the recently postponed release date for potato (Debian), I'm
> wondering if this is just a benchmark thing, or if it really "feels" faster
> (such as scrolling in Swing for exmample)?
>
> I can't decide whether to go to the potential trouble of running an "unstable"
> version of Debian, just for the sake of being able to run IBM's JDK.

I have tried both IBM JDK 1.1.8 and Blackdown under Linux. When you run graphical 
Swing applications you won't notice much of a difference in drawing speed (at least I 
didn't). But if you are creating a server applications you will probably benefit from 
using the IBM JDK. We ran some benchmarks on our Java servlets using JMeter and the 
IBM JDK was superior to Blackdowns JDK. When simulating a lot of clients the memory 
usage of the IBM JDK was *much* lower and as a result the message throughput was much 
higher.

--
| Jesper Nordenberg, M.Sc. in C.S.E.NNL Technology AB
| E-mail: [EMAIL PROTECTED] Teknikringen 1A
| Phone:  +46 13 211400 S-583 30 Linköping
| Internet: www.nnl.se, wap.nnl.se  SWEDEN




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: cut & paste

1999-11-09 Thread Nathan Meyers

X11 has a couple of different cut/paste-type operations:

1) The clipboard, which is accessed from cut, copy, and paste buttons in
various X applications. Java supports this.

2) The primary selection, where you "copy" by dragging the mouse over
text and typically "paste" by clicking the middle mouse button. Java
doesn't support this.

It sounds like you're trying to use primary selection. I've got a simple
JNI-based class that will give you access to the X primary selection. It
doesn't integrate with java.awt.datatransfer - it's just a simple call
that returns a string - but it may solve your problem.

Look for XClipboard at http://www.teleport.com/~nmeyers/FreeWare.

Nathan


Edwin Park wrote:
> 
> Hi,
> 
> I'm trying to cut & paste string selections in Java on Linux, and am
> running into some problems.  Cut & paste works fine between Java
> applications that pass DataFlavor.stringFlavor types, but when I try to
> cut & paste between non-Java applications and Java, the Transferrable is
> of type sun.awt.motif.X11Selection, and calling getTransferDataFlavors()
> on the transferrable returns null - i.e. there is no way to get data
> from the transferrable selection.  The same code works fine under
> Windows - selections there are instances of
> java.awt.datatransfer.StringSelection, and they support both
> DataFlavor.stringFlavor and DataFlavor.plainTextFlavor.  Can anyone tell
> me why this is happening?
> 
> Here's a code snippet:
> 
> Toolkit tk = Toolkit.getDefaultToolkit();
> Clipboard clipboard = tk.getSystemClipboard();
> Transferable trans = clipboard.getContents(this);
> DataFlavor flavors[] = trans.getTransferDataFlavors();  // returns null
> under Linux jdk1.2 pre-v2
> Object data = trans.getTransferData(DataFlavor.stringFlavor);  //
> java.io.IOException: could not get transfer data at
> sun.awt.motif.X11Selection.getTransferData(X11Selection.java:273)
> 
> Thanks,
> Edwin
> 
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Swing with ibm jdk 1.1.8

1999-11-09 Thread Daniel P. Zepeda

I think you have to set JAVA_HOME to /path/to/jdk118

Thus spake Pere Serra on Tue, 09 Nov 1999:
> I've downloaded ibm jdk 1.1.8 and it works with text mode programs, but when I
> try to run a swing application it doesn't work. I put the file rt.jar in the
> classpath then java says Class not found: java.lang.System.
> 
> Does anyone know what am I doing wrong ?
> 
> Thanks a lot
> 
> --
> -
> (,   http://www.geocities.com/Hollywood/Set/8660
> /|__--__
> |\ '__
> `.' / `.,_ _
> /  ||``._.'
>   .'   /|Pere Joan Serra Caldentey
> .'/\ \
> `` `,/ /`,\  [EMAIL PROTECTED]
>.'.'  /|
> ,' /   / |
> - `- -- `-'- ---
> 
> 
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
--
Daniel P. Zepeda
[EMAIL PROTECTED]

"May the Schwartz be with you." -- Yogurt in Spaceballs. (MMM, yummy!)


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



jdk version

1999-11-09 Thread Raj Patel

Hi,
I am having few troubles using jdk1.2pre-v2(glib2.0) on Redhat
Linux 6.0.  I used jdk1.1.7 with swing module (Redhat Linus 5.2) for my
swing application which is using JNI.  Now after installing
jdk1.2pre-v2(glib2.0)  application complains about swing classes during
compilation as,

Fsa.java:434: class JLabel not found in class Fsa
JLabel name = new JLabel("name: ");
Fsa.java:437: class JButton not found in class Fsa
JButton createForce = new JButton("Create my Force");
:
makerFSDB: javah: command not found

Everything was working fine under jdk1.1.7 with swing module
With jdk1.2pre-v2 i don't think i have to add swing module because it is
built in correct?
Do i need to set any PATH or something to find different swing classes?
Why it is not finding javah command?  It is there in bin directory when
i tried to run from there i got message,
Error: can't find libjava.so.

Can anyone suggest what's missing?

Thanks,
-Raj


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Speed of IBM's Linux JDK

1999-11-09 Thread Daniel P. Zepeda

Well,  I did a very unscientific test of my own. I went through the
trouble of installing jdk118 for linux + Swing. Then I tried to run the
SwingSet examples. I run a Mandrake 6.0 machine, so it hung. At someone's
suggestion I replaced the libpthreads library with one from a RedHat 6.0
machine. jdk118 ran SwingSet, but it took nearly twice as long to load
than did blackdown's jdk117_v3. (42 second/ 26 seconds). Just clicking
through the example in the SwingSet didn't really feel any faster, but
this is a purely subjective "measure". 

Thus spake Peter Schuller on Tue, 09 Nov 1999:
> Hello!
> 
> Quick question: the IBM JDK has shown *very* impressive benchmark results.
> Now, in light of the recently postponed release date for potato (Debian), I'm
> wondering if this is just a benchmark thing, or if it really "feels" faster
> (such as scrolling in Swing for exmample)?
> 
> I can't decide whether to go to the potential trouble of running an "unstable"
> version of Debian, just for the sake of being able to run IBM's JDK.
> 
> Thank you,
> 
> -- 
> / Peter Schuller
> 
> PGP userID: 0x5584BD98 or 'Peter Schuller <[EMAIL PROTECTED]>'
> Key retrival: Send an E-Mail to [EMAIL PROTECTED]
> E-Mail: [EMAIL PROTECTED] Web: http://hem.passagen.se/petersch
> 
> 
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
--
Daniel P. Zepeda
[EMAIL PROTECTED]

"May the Schwartz be with you." -- Yogurt in Spaceballs. (MMM, yummy!)


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Speed of IBM's Linux JDK

1999-11-09 Thread Dennis Keller

It depends on what the Swing app will be doing. If there isn't much user
interaction, you won't see much of a difference. But if there is, you'll
see a huge difference. For instance, I use an editor called "JEdit" on
my linux box. This involves a lot of scrolling and graphical operations.
I find that the IBM JDK is way faster than blackdown's. In fact, on my
machine, I find JEdit useless with blackdown because of the lag
associated with drawing the text panel. With IBM'S I can barely tell
that it is a Java app and not native.

So it depends on what you'll be doing!

Dennis
[EMAIL PROTECTED]

Jesper Nordenberg wrote:
> I have tried both IBM JDK 1.1.8 and Blackdown under Linux. When you run graphical 
>Swing applications you won't notice much of a difference in drawing speed (at least I 
>didn't). But if you are creating a server applications you will probably benefit from 
>using the IBM JDK. We ran some benchmarks on our Java servlets using JMeter and the 
>IBM JDK was superior to Blackdowns JDK. When simulating a lot of clients the memory 
>usage of the IBM JDK was *much* lower and as a result the message throughput was much 
>higher.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



installation??

1999-11-09 Thread Raj Patel

Hi,
I just posted the question regarding jdk1.2pre-v2.  I think it's
more of a installation problem.  After installing jdk1.2pre-v2 and
setting PATH to bin directory when i tried javac command i got following
error,

black:rpatel% javac

*** panic: GC: getStickySystemClass failed: java/lang/ref/Reference
 CLASSPATH may be incorrect
SIGABRT   6*   abort (generated by abort(3) routine)
 stackpointer=0xb2c0

Full thread dump Classic VM (Linux_JDK_1.2_pre-release-v2, native
threads):
"main" (TID:0x403611e0, sys_thread_t:0x804c498, state:R, native
ID:0x400) prio=5: pending=java.lang.OutOfMemoryError
Monitor Cache Dump:
Registered Monitor Dump:
utf8 hash table: 
JNI pinning lock: 
JNI global reference lock: 
BinClass lock: 
Class linking lock: 
System class loader lock: 
Code rewrite lock: 
Heap lock: 
Monitor cache lock: owner "main" (0x804c498) 1 entry
Thread queue lock: owner "main" (0x804c498) 1 entry
Dynamic loading lock: 
Monitor registry: owner "main" (0x804c498) 1 entry

I downloaded jdk1.2pre-v2(glibc2.0) for my Redhat linux 6.0.  Am i
missing anything??

-Raj


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: installation??

1999-11-09 Thread Juergen Kreileder

> Raj Patel writes:

Raj> I just posted the question regarding jdk1.2pre-v2.  I think
Raj> it's more of a installation problem.  After installing
Raj> jdk1.2pre-v2 and setting PATH to bin directory when i tried
Raj> javac command i got following error,

Raj> *** panic: GC: getStickySystemClass failed: java/lang/ref/Reference
Raj>  CLASSPATH may be incorrect
Raj> SIGABRT   6*   abort (generated by abort(3) routine)
Raj>  stackpointer=0xb2c0

Raj> I downloaded jdk1.2pre-v2(glibc2.0) for my Redhat linux 6.0.  Am i
Raj> missing anything??

You need the glibc-2.1 JDK.


Juergen

-- 
Juergen Kreileder, Blackdown Java-Linux Porting Team
http://www.blackdown.org/java-linux.html


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Garbage collection in jdk1.2

1999-11-09 Thread Daniel P. Zepeda

Hi,
So I have this simple application that uses a JPanel as a canvas.
I use arrays of  Point2D.Double and Line2D.Double objects to to keep track
of where to draw lines/points. This canvas can have around 1000 point
objects and about 300-400 line objects associated with it. After I use
this canvas to display, I simply throw it away for a new one like:

myCanvas c;
...
c= new myCanvas(); 

Now in linux using the jdk1.2-pre_v2, the programs memory requirement
grows without bound until it crashes my system.  Sun's jdk doesn't do
this. It settles in with about 10 megs in memory and 30 megs in swap and
wil stay there all day. This is what I expected in the first place, that
the program would grow for awhile until the allocation to Garbage
Collection ratio settled out. 

Is this a know problem in the Linux JDK? 

I have another question that is related to this problem, but not to
linux-java specifically:

How can I tell how much memory an object takes? I'm interested to know how
big a Dimension object or a Point2D.Double object is, compared to say, a
primitive double. I realize the Point2D.Double object will be larger, but
by how much? Would it make more sense just to keep my coordinates in
double arrays make a shape and draw it, rather than keeping the whole
shape in an array to draw it?

Any insights would be appreciated.


  --
Daniel P. Zepeda
[EMAIL PROTECTED]

"May the Schwartz be with you." -- Yogurt in Spaceballs. (MMM, yummy!)


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Garbage collection in jdk1.2

1999-11-09 Thread Marc Slemko

On Tue, 9 Nov 1999, Daniel P. Zepeda wrote:

[...]
> Now in linux using the jdk1.2-pre_v2, the programs memory requirement
> grows without bound until it crashes my system.  Sun's jdk doesn't do
> this. It settles in with about 10 megs in memory and 30 megs in swap and
> wil stay there all day. This is what I expected in the first place, that
> the program would grow for awhile until the allocation to Garbage
> Collection ratio settled out. 
> 
> Is this a know problem in the Linux JDK? 

Erm... the way to find out about known bugs is to go to the page listing
known bugs (http://www.blackdown.org/java-linux/jdk1.2-status/known-bugs.html;
easy to find, and referenced in numerous places), which says:

  Garbage collector doesn't work 
This is a bug with the native threads vm in 1.2pre2. A work-around
is to use green threads ('export THREADS_FLAG=green'), or pass
-green on the command line.



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Visibroker for Java 3.4

1999-11-09 Thread Luis Claudio Santos






Hello,
 
    Can anybody HELP ME, PLEASE 
:-( ?
 
    
I'm using Linux RH 5.2 and JDK1.1.7.    

    I download the 
Visibroker for Java 3.4 (linux version) from  http://www.inprise.com/downloads/.
    After I followed all the 
instructions for instalation I tryed some commands and ...:
 
1) [root@lc bin]# oadj 
-help    ISO-8859-1: unknown locale2) [root@lc bin]# 
java2idl    ISO-8859-1: unknown 
locale 
What's happening?
Can anybody help me, please?
 
    Best regards :-)
    -Claudio.


Re: Garbage collection in jdk1.2

1999-11-09 Thread Daniel P. Zepeda

I actually looked at that page. I saw known bugs, and skipped fix bugs
thinking it wouldn't apply. Also, that green color makes the entries very
hard to read on my LCD screen. 

Anway, that did work around the problem. It behaves as expected now.




Thus spake Marc Slemko on Tue, 09 Nov 1999:
> On Tue, 9 Nov 1999, Daniel P. Zepeda wrote:
> 
> [...]
> > Now in linux using the jdk1.2-pre_v2, the programs memory requirement
> > grows without bound until it crashes my system.  Sun's jdk doesn't do
> > this. It settles in with about 10 megs in memory and 30 megs in swap and
> > wil stay there all day. This is what I expected in the first place, that
> > the program would grow for awhile until the allocation to Garbage
> > Collection ratio settled out. 
> > 
> > Is this a know problem in the Linux JDK? 
> 
> Erm... the way to find out about known bugs is to go to the page listing
> known bugs (http://www.blackdown.org/java-linux/jdk1.2-status/known-bugs.html;
> easy to find, and referenced in numerous places), which says:
> 
>   Garbage collector doesn't work 
> This is a bug with the native threads vm in 1.2pre2. A work-around
> is to use green threads ('export THREADS_FLAG=green'), or pass
> -green on the command line.
> 
> 
> 
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
--
Daniel P. Zepeda
[EMAIL PROTECTED]

"May the Schwartz be with you." -- Yogurt in Spaceballs. (MMM, yummy!)


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Speed of IBM's Linux JDK

1999-11-09 Thread Dimitrios Vyzovitis

Peter Schuller wrote:

> Hello!
>
> Quick question: the IBM JDK has shown *very* impressive benchmark results.
> Now, in light of the recently postponed release date for potato (Debian), I'm
> wondering if this is just a benchmark thing, or if it really "feels" faster
> (such as scrolling in Swing for exmample)?
>
> I can't decide whether to go to the potential trouble of running an "unstable"
> version of Debian, just for the sake of being able to run IBM's JDK.

I get a 3x improvement for heavy computation (wavelet image compression), but
there is no noticeable difference for gui apps. It depends on what you want to
do. Also note that blackdown's green threads seem much more stable than ibm's
native.


-- dimitris




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Speed of IBM's Linux JDK

1999-11-09 Thread Peter Schuller

Hello!

Quick question: the IBM JDK has shown *very* impressive benchmark results.
Now, in light of the recently postponed release date for potato (Debian), I'm
wondering if this is just a benchmark thing, or if it really "feels" faster
(such as scrolling in Swing for exmample)?

I can't decide whether to go to the potential trouble of running an "unstable"
version of Debian, just for the sake of being able to run IBM's JDK.

Thank you,

-- 
/ Peter Schuller

PGP userID: 0x5584BD98 or 'Peter Schuller <[EMAIL PROTECTED]>'
Key retrival: Send an E-Mail to [EMAIL PROTECTED]
E-Mail: [EMAIL PROTECTED] Web: http://hem.passagen.se/petersch


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



IllegalMonitorStateException when running javac?

1999-11-09 Thread Jari . P . Kinnunen


Hi!

I have suddenly started to get following exception
when running javac. Does anyone know a reason for this
and how I can fix this. It seems that the compilation
goes anyway fine.
I am using Linux_JDK_1.2_pre-release-v2

java.lang.IllegalMonitorStateException: current thread not owner
at java.lang.Object.wait(Native Method)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:112)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:174)

Thanks!

Jari


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Speed of IBM's Linux JDK

1999-11-09 Thread Peter Graves

It does feel faster, once it gets going, but it seems like the first
time a given piece of code is run, there's a noticeable delay
(presumably because the JIT compiler is doing its thing).  This occurs,
for example, the first time you bring up a dialog box in a Swing app. 
It also makes application startup significantly slower.  But for code
the JIT compiler has already seen, it definitely feels faster to me.

YMMV.

-Peter

Peter Schuller wrote:
> 
> Hello!
> 
> Quick question: the IBM JDK has shown *very* impressive benchmark results.
> Now, in light of the recently postponed release date for potato (Debian), I'm
> wondering if this is just a benchmark thing, or if it really "feels" faster
> (such as scrolling in Swing for exmample)?
> 
> I can't decide whether to go to the potential trouble of running an "unstable"
> version of Debian, just for the sake of being able to run IBM's JDK.
> 
> Thank you,
> 
> --
> / Peter Schuller
> 
> PGP userID: 0x5584BD98 or 'Peter Schuller <[EMAIL PROTECTED]>'
> Key retrival: Send an E-Mail to [EMAIL PROTECTED]
> E-Mail: [EMAIL PROTECTED] Web: http://hem.passagen.se/petersch
> 
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]