JVMDI ( Calvin perhaps ? )

1999-07-06 Thread jools enticknap

Hi

I was wondering if anyone can shed any light on how SUN are going to license 
the JVMDI code.

I've loocked around on the Community license web page, but failed to locate 
anything.

I noticed we currently have the header file in the 1.2 release, but alas 
there is no library to accompany it. ( which I can find, that is )

If the code needs to be ported ( and i understand it's pretty hairy stuff) 
then I'm happy to start the port, and also lobbing SUN for it's release ( if 
required ).


Regards

--Jools





__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: JVMDI ( Calvin perhaps ? )

1999-07-06 Thread jools enticknap


>jools enticknap wrote:
> >
> > Hi
> >
> > I was wondering if anyone can shed any light on how SUN are going to 
>license
> > the JVMDI code.
> >
> > I've loocked around on the Community license web page, but failed to 
>locate
> > anything.
> >
> > I noticed we currently have the header file in the 1.2 release, but alas
> > there is no library to accompany it. ( which I can find, that is )
>
>I think it's there... I'm pretty sure jdb uses it (remotely). There's a
>jvmdi_interface to be found in libagent.so.
>
>What's not there yet is JDWP and JDI, but if you want to go straight to
>JVMDI, it looks to me like you can.
>
>Nathan
>

Thanks for the information. As you say the JVMDI is available but the JDI 
and the JDWP does not appear to be available.

Looking at the sparc release it appears to require the following shared 
libs;

libdt_socket.so
libjdwp.so

So I guess I need to code for these libraries.

Regards

--Jools



__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: favorite code beautifiers?

1999-07-06 Thread jools enticknap

>
>Hendrik Schreiber wrote:
> > Michael Thome wrote:
> >
> > > Any suggestions for nice code beautifiers (for java)?  Beautifiers
> > > written in java would, of course, be preferred, but as long as it runs
> > > under linux (C/C++/whatever)...
>
>Artistic Style was quite nice.
>
>--
>Rachel

Check out:
http://gene.md.huji.ac.il/~tald/jstyle/

I don't use it myself ( would cause a religious war here ), just bumped into 
it a while ago.

Regards

--Jools


__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: UnsatisfiedLinkErr in JNI

1999-07-07 Thread jools enticknap


Hi

I use JNI a great in my current work, and normally find that when I get this 
exception it is a typo.

Try running javap -s  and make sure that signatures match up.

Regards

--Jools

>Hi,
>
>I got an UnsatisfiedLinkErr exception in calling a second native method
>from Java (not a nested JNI call). I checked signature of the method and 
>made
>sure they're consistent in both sides. It still happens. Anyone know what 
>this
>error really means? Is there a limitation as to how many native methods one
>Java Object can have?
>
>I tested my JNI stuff with a single native method in various JNI
>interactions between the Java and Native functions, and so far everyting 
>works
>fine until I introduced a second native method.
>
>Thanks in advance,
>
>
>
>
>Get your own FREE, personal Netscape WebMail account today at 
>http://webmail.netscape.com.
>
>
>--
>To UNSUBSCRIBE, email to [EMAIL PROTECTED]
>with a subject of "unsubscribe". Trouble? Contact 
>[EMAIL PROTECTED]
>


__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: Java3D and 'main()'

1999-07-07 Thread jools enticknap


Hi Rob

I would suggest that you add win.setVisible( true ) after initialization in 
order to get AWT to manage the window.

Regards

--Jools



>From: Rob Nugent <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Java3D and 'main()'
>Date: Wed, 07 Jul 1999 15:57:05 +0100
>
>I am sure that the following is a User Error on my part, but if anyone can 
>explain what I am doing wrong
>I'd appreciate it:
>
>I have a Java3D program that runs just fine on WinNT. All my 
>geometry/behaviours etc are created
>in a function called init() which is called from the 'main' of my first 
>class.
>
>Now on WinNT, the renderer runs fine for ever, however under Linux, the 
>program terminates when
>main() exits. I have put a sleep() into the end of the init function to 
>prove this, and with the sleep at 10
>seconds, my window evaporates after 10 seconds, but on Linux only, not on 
>NT.
>
>If anyone can help or explain, I'd appreciate it.
>
>Rob
>
>Start class code follows:
>
>snip
>package rob.ref;
>
>import java.awt.BorderLayout;
>import java.awt.Dimension;
>import java.awt.Graphics;
>import java.awt.Toolkit;
>
>import java.awt.event.WindowEvent;
>import java.awt.event.WindowListener;
>
>import javax.media.j3d.BranchGroup;
>import javax.media.j3d.TransformGroup;
>import javax.media.j3d.VirtualUniverse;
>import javax.media.j3d.Locale;
>
>import javax.swing.JPanel;
>import javax.swing.JFrame;
>
>
>
>public class Start implements WindowListener
>{
> private VirtualUniverse  u;
> private Locale   l;
> private Camera   cam;
> private static boolean  fullScreen = false;
>
> private JPanel   pan;
> private JFrame   win;
>
> public void init()
> {
>  u  = new VirtualUniverse();
>  l = new Locale(u);
>  cam = new Camera();
>
>  pan = new JPanel()
>  {
>  public Dimension getPreferredSize()
>  {
>   if (fullScreen)
>   {
>   return Toolkit.getDefaultToolkit().getScreenSize();
>   }
>
>   return new Dimension(640,400);
>  }
>  };
>
>  win = new JFrame()
> {
>  public void update(Graphics g)
>  {
>   paint(g);
>  }
> };
>  pan.setLayout(new BorderLayout(0,0));
>  pan.add(BorderLayout.CENTER,cam.getCanvas3D());
>  win.getContentPane().setLayout(new BorderLayout(0,0));
>  win.getContentPane().add(BorderLayout.CENTER,pan);
>  win.pack();
>  win.setVisible(true);
>  win.pack();
>  win.setLocation(0,0);
>
>  MaterialManager.init();
>  TextureManager.init(win);
>  AppearanceManager.init();
>
>  l.addBranchGraph(cam.getBranchGroup());
>
>  Snake s = new Snake();
>  l.addBranchGraph(s.getBranchGroup());
>
>  BackgroundLight bl = new BackgroundLight();
>  l.addBranchGraph(bl.getBranchGroup());
>
>  PositionalLamp pl = new PositionalLamp();
>  l.addBranchGraph(pl.getBranchGroup());
>
>  win.addWindowListener(this);
>
>  for (int i = 0; i < 1; i++)
>  {
>  try
>  {
>   Thread.sleep(1);
>  }
>  catch(InterruptedException e)
>  {
>  }
>  }
>
> }
>
> public static void main(String[] args)
> {
> if ((args.length > 0) && (args[0].equals("-f")))
> {
> System.out.println("Full Screen");
> fullScreen = true;
> }
>
>  Start s = new Start();
>  s.init();
> }
>
> public void windowActivated(WindowEvent e)
> {
> }
> public void windowDeactivated(WindowEvent e)
> {
> }
> public void windowOpened(WindowEvent e)
> {
> }
> public void windowClosed(WindowEvent e)
> {
> }
> public void windowClosing(WindowEvent e)
> {
> }
> public void windowIconified(WindowEvent e)
> {
> }
> public void windowDeiconified(WindowEvent e)
> {
> }
>}
>snip
>
>
>
>--
>
>
>Rob Nugent
>Development Manager
>UniKix Technologies Europe
>[EMAIL PROTECTED]
>http://www.unikix.com
>Tel: +44 (0) 1489 585503
>Fax: +44 (0) 1489 881363
>
>
>
>--
>To UNSUBSCRIBE, email to [EMAIL PROTECTED]
>with a subject of "unsubscribe". Trouble? Contact 
>[EMAIL PROTECTED]
>


__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: Java3D and 'main()'

1999-07-07 Thread jools enticknap


Ops Sorry.

Forget this post, I just noticed that you did have setVisible( true )
in your code.

Time to crawl under a stone !!!

--Jools


>From: jools enticknap <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED], [EMAIL PROTECTED]
>Subject: Re: Java3D and 'main()'
>Date: Wed, 07 Jul 1999 08:28:02 PDT
>
>
>Hi Rob
>
>I would suggest that you add win.setVisible( true ) after initialization in
>order to get AWT to manage the window.
>
>Regards
>
>--Jools
>
>
>
>>From: Rob Nugent <[EMAIL PROTECTED]>
>>To: [EMAIL PROTECTED]
>>Subject: Java3D and 'main()'
>>Date: Wed, 07 Jul 1999 15:57:05 +0100
>>
>>I am sure that the following is a User Error on my part, but if anyone can
>>explain what I am doing wrong
>>I'd appreciate it:
>>
>>I have a Java3D program that runs just fine on WinNT. All my
>>geometry/behaviours etc are created
>>in a function called init() which is called from the 'main' of my first
>>class.
>>
>>Now on WinNT, the renderer runs fine for ever, however under Linux, the
>>program terminates when
>>main() exits. I have put a sleep() into the end of the init function to
>>prove this, and with the sleep at 10
>>seconds, my window evaporates after 10 seconds, but on Linux only, not on
>>NT.
>>
>>If anyone can help or explain, I'd appreciate it.
>>
>>Rob
>>
>>Start class code follows:
>>
>>snip
>>package rob.ref;
>>
>>import java.awt.BorderLayout;
>>import java.awt.Dimension;
>>import java.awt.Graphics;
>>import java.awt.Toolkit;
>>
>>import java.awt.event.WindowEvent;
>>import java.awt.event.WindowListener;
>>
>>import javax.media.j3d.BranchGroup;
>>import javax.media.j3d.TransformGroup;
>>import javax.media.j3d.VirtualUniverse;
>>import javax.media.j3d.Locale;
>>
>>import javax.swing.JPanel;
>>import javax.swing.JFrame;
>>
>>
>>
>>public class Start implements WindowListener
>>{
>> private VirtualUniverse  u;
>> private Locale   l;
>> private Camera   cam;
>> private static boolean  fullScreen = false;
>>
>> private JPanel   pan;
>> private JFrame   win;
>>
>> public void init()
>> {
>>  u  = new VirtualUniverse();
>>  l = new Locale(u);
>>  cam = new Camera();
>>
>>  pan = new JPanel()
>>  {
>>  public Dimension getPreferredSize()
>>  {
>>   if (fullScreen)
>>   {
>>   return Toolkit.getDefaultToolkit().getScreenSize();
>>   }
>>
>>   return new Dimension(640,400);
>>  }
>>  };
>>
>>  win = new JFrame()
>> {
>>  public void update(Graphics g)
>>  {
>>   paint(g);
>>  }
>> };
>>  pan.setLayout(new BorderLayout(0,0));
>>  pan.add(BorderLayout.CENTER,cam.getCanvas3D());
>>  win.getContentPane().setLayout(new BorderLayout(0,0));
>>  win.getContentPane().add(BorderLayout.CENTER,pan);
>>  win.pack();
>>  win.setVisible(true);
>>  win.pack();
>>  win.setLocation(0,0);
>>
>>  MaterialManager.init();
>>  TextureManager.init(win);
>>  AppearanceManager.init();
>>
>>  l.addBranchGraph(cam.getBranchGroup());
>>
>>  Snake s = new Snake();
>>  l.addBranchGraph(s.getBranchGroup());
>>
>>  BackgroundLight bl = new BackgroundLight();
>>  l.addBranchGraph(bl.getBranchGroup());
>>
>>  PositionalLamp pl = new PositionalLamp();
>>  l.addBranchGraph(pl.getBranchGroup());
>>
>>  win.addWindowListener(this);
>>
>>  for (int i = 0; i < 1; i++)
>>  {
>>  try
>>  {
>>   Thread.sleep(1);
>>  }
>>  catch(InterruptedException e)
>>  {
>>  }
>>  }
>>
>> }
>>
>> public static void main(String[] args)
>> {
>> if ((args.length > 0) && (args[0].equals("-f")))
>> {
>> System.out.println("Full Screen");
>> fullScreen = true;
>> }
>>
>>  Start s = new Start();
>>  s.init();
>> }
>>
>> public void windowActivated(WindowEvent e)
>> {
>> }
>> public void windowDeactivated(WindowEvent e)
>> {
>> }
>> public void windowOpened(WindowEvent e)
>> {
>> }
>> public void windowClosed(WindowEvent e)
>> {
>> }
>>  

Re: IBM-jdk

1999-07-08 Thread jools enticknap


>Anybody played around with the IBM-JDK for Linux?  I've run one
>test-program that creates 10 threads, allocates an array and puts some
>random numbers in that array.  It seems extremely fast.  It beats kaffe
>(by a large margin) and even the SUN-JDK on Solaris (with a faster
>processor)!
>

Yep, I evaluated it about a week ago. It's VERY fast and pretty reliable.

However it's only 1.1.6 and I really need 1.2 for my work, but I think it 
shows us that IBM is serious about Java.

--Jools


P.S.

Please note that IBM have only appeared to have released a version for glibc 
2.1 NOT 2.0. So don't bother unless you are running suse 6.1 or Redhat 6.0 
or a glibc 2.1 based system.

You can pick it up from;

http://www.alphaworks.ibm.com/tech/linuxjvm





__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: Swing -- AWT dependencies

1999-07-08 Thread jools enticknap

>I was wondering to what extent Swing depends on the native AWT Toolkit in
>the JVM.  In (simplistic) theory the toolkit primarily needs to be able to
>supply a particular platform's implementation of a frame, and a drawing
>surface. In other words, the only heavyweight peers involved are for frames
>and images. Is this the case the way Swing is currently implemented? Is
>there any difference between 1.1 and 1.2 in this respect?
>

This is pretty much correct. The Idea is that AWT only supplies the minimum 
needed from the OS, and Swing then draws the actual components. This is why 
you can have the same look and feel on two different platforms, because the 
underlying OS does not draw the components.

If you have a look at the API docs that come with the JDK, or the swing 
download ( if you are using 1.1 ) you can see what I mean. If you look at 
say JButton;

java.lang.Object
  |
  +--java.awt.Container
  |
  +--javax.swing.JComponent
|
+--javax.swing.AbstractButton
  |
  +--javax.swing.JButton

And then the AWT button.( which is a Native Peer )

java.lang.Object
  |
  +--java.awt.Component
|
+--java.awt.Button

Regards

--Jools


__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: IBM-jdk

1999-07-08 Thread jools enticknap


>how would you go about upgrading from glibc 2.0 to 2.1.
>(it is glibc2.0 in redhat5.1, is it?) and is it a trivial matter,
>or can it be very messy? I'm relatively new in Linux.

It's not for the faint hearted, and it can get a bit messy.
Use a 2.1 based distribution if you can.

Check out the news groups for more information..

Regards

--Jools



__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: Has Sun Overstretch Themselves With So Many APIs?

1999-07-08 Thread jools enticknap

>I am wondering if Sun has overstretch itself in trying to develop so
>many APIs? It seems to me that they are struggling and there is enough
>support and help to help outsiders (like Blackdown who done an excellent
>job porting the software)?



Perhaps this is a direct result of trying to bring an open technology to 
market, and at the same time protect the one thing that makes Java useful in 
the first place (write once, run everywhere(TM)).

Also once a technology is invented it needs time for the comunity to 
evaluate and comment on whats been done, and these comments must also be 
evaluted and the next step then taken.

This all takes time, however I for one and happy this does take place.

As for porting assistance, I think that you will find that SUN has __very__ 
close links with the blackdown guys and do offer help when it's requested.


 ( for what it's worth )

Regards

--Jools


__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: JAVA multithread questions.

1999-07-13 Thread jools enticknap


Hi

This sort of problem is fairly common and Java is more than capable of 
dealing with it.

I would guess from the questions that you have asked, you need a little 
information on both Threads and the networking API.

There are two resources that I would recommend;

1) The Java Tutorial page
   http://java.sun.com/docs/books/tutorial/
   (I would suggest downloading the HTML and examples)

2) Or visit www.ora.com, they have a number of books that
   are invaluable to the Java Developer.

   Threads:-
   http://www.oreilly.com/catalog/jthreads2/

   Networking:-
   http://www.oreilly.com/catalog/javanetwk/

   BTW all the example code is on their website.


Best of Luck with your project :-)

--Jools


>
>I am doing java networking program. Since my project have a little trick
>architecture, I am planning to use JAVA as my design language.
>
>The Questions are:
>1. one of my machine called PS have to connect to 3 different servers (R1,
>R2, and R3) to collect info. So PS have to make connect with R1, R2, and
>R3. I want PS to connect Servers independently, that means, the
>connection is concurrent, not sequence. How can I do that?
>
>2. I think PS is a very important part in my project. As I mentioned on 1.
>PS is a client to communicate with 3 servers. However, PS is also a serevr
>to be trigger by Q. How can I deal with this situation? Is JAVA
>multithread can solve my question?
>
>
>
>The configuration I try to solve is as following.
>
>
>+-<-->R1
>   /
>   Q<-> PS-<---> R2
>   \
>+---<---> R3
>
>How can I use java multithread to desigm my program, such that PS can
>communicate with R1, R2, and R3 respectly, and PS also can receive Q's
>triger to satisfy Q's request?
>
>Can anyone give me some hints or guideline to do it? Do anyone can point
>out some material about JAVA multithread and java network programming?
>
>Any suggestion will be appreciated.
>
>
>C. L.
>
>
>--
>To UNSUBSCRIBE, email to [EMAIL PROTECTED]
>with a subject of "unsubscribe". Trouble? Contact 
>[EMAIL PROTECTED]
>
>


__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: JNI/Linux pointers?

1999-07-15 Thread jools enticknap


Hi
>
>Does anybody have any pointers to using JNI on Linux?  I'm starting a
>project where I'll be hacking pine to access a running Java process.
>

JNI on Linux is much the same on all platforms( more or less:).
If you want a good book on JNI I suggest you try 'Essential JNI' by Rob 
Gordon. It's a very good book. The ISBN is 0-13-679895-0.

Or you could try the Java Tutorial, under specialized Trails there is a 
section on JNI.

The Java Tutorial can be found at :-
   http://java.sun.com/docs/books/tutorial/index.html


Or if you're interested I have written a Java to C++ program which produces 
C++ code which maps from a Java class. If you want the parser please drop me 
a line and I'll send you the code.

It only the second version, but it's not too bad :-)

--Jools



__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: Off-Topic (JNI)

1999-07-26 Thread jools enticknap


Hi

Hope this code answers your question ..

Best of luck.

--Jools


JNIEXPORT void JNICALL Java_MyFunction
(JNI Env *env, jobject my_object,jobjectArray my_array)
{
  // It's always a good Idea to get the length of the array first.
  jint len = (*env)->GetArrayLength( my_array );

  // Check that it does have at least one element.
  if ( len < 1 ) {
 return;
  }

  // Get a jstring object from the array/
  jstring jstr = (jstring) (*env)->GetObjectArrayElement(env,
 my_array, 0);

  // Get a pointer to the string.
  jboolean iscpy;
  const char *cstr = (*env)->GetStringUTFChars( jstr, iscpy );

  // lets see what it is :-)
  printf("%s\n", cstr );

  // Check to see if we need to release the string.
  if ( iscpy == JNI_TRUE )
(*env)->ReleaseStringUTFChars( jstr, cstr );

  // Need to release the local reference.
  // If you are in a loop, don't forget to release each reference
  // or you will run out of local references :-(
  (*env)->DeleteLocalRef( jstr );
}



>Hi Jini users,
>Excuse me for asking this question !!.It is a part of my Jini Service
>which uses Java Native interafce with C.I am new to Java, I have written
>a small java code which calls a C function by passing a string
>array(2D). Following is the native function C code which prints garbage
>when I execute 'java' of my java class. It is perfectly printing the
>length of the array but not the contents of the arrya.How to access the
>contents of string array and also how
>to return a 2D array from C to java and read in java?.
>-
>...
>JNIEXPORT void JNICALL Java_MyFunction
>(JNI Env *env, jobject my_object,jobjectArray my_array)
>{
>  jobject value1 = (*env)->GetObjectArrayElement(env, my_array, 1);
>  printf("%s\n",value1);
>}
>-
>Thanks in advance,
>Nagaraj
>
>
>--
>To UNSUBSCRIBE, email to [EMAIL PROTECTED]
>with a subject of "unsubscribe". Trouble? Contact 
>[EMAIL PROTECTED]
>


__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: Gosling says he wants to support Java on Linux

1999-09-09 Thread jools enticknap



This is not a flame, just a comment :-)

Or perhaps it's just down to the fact that the JVM was originally coded 
on Solaris. Although Solaris and Linux are fairly common on a number of 
fronts, they differ on a great many too.

Perhaps the best way to solve the problem ( although it's more bit more 
bullish) is to go the clean room approach. Do it from scratch and make the 
JVM fit the OS, the same way SUN did with it's Solaris VM.

And lets not forget, SUN is not a charity and it's going to have to sell a 
few StarFire's to cover some of it's development costs. If people like VA 
start selling Linux Boxes at a third of the cost, plus 24/7 support, why buy 
SUN ?

Plus let's not forget IBM. I've been using jikes and their VM, which is 
pretty damn quick and stable, and they are practically gagging to sell Linux 
boxes (AIX, what happened ? ).

So all in all, SUN need to make some money out of Java, if they help to make 
Java too good on Linux, nobody will need to buy SUN servers. So why should 
SUN help ?

Write once, run anywhere ( or was that debug everywhere :) might not be so 
helpful to SUN's bottom line.

I'm a bit of a pessimist, I do hope that I'm totally wrong ( when was 
jdk1.2pre2 released )




>From: [EMAIL PROTECTED] (Nelson Minar)
>To: [EMAIL PROTECTED]
>Subject: Gosling says he wants to support Java on Linux
>Date: Thu, 9 Sep 1999 11:50:21 -0400 (EDT)
>
>An interview with Gosling is at
>   
>http://webserv.vnunet.com/www_user/plsql/pkg_vnu_search_mo.right_frame?p_story=89624
>
>Suprising quote:
>
>   Zombiehead: James, what's your stance on Java in relation to open
>   source? It's one of the reasons Linux is successful. Do you see this
>   as a future possibility?
>
>   JG: We'd like to deal with the problem of Java not working on Linux.
>   It's a somewhat complex problem.
>
>   The inter-operability problems with Linux are just horrible. You
>   have to be excruciatingly careful because all the different flavours
>   of Linux are all slightly different.
>
>   NN: Can you project a time when problems are resolved?
>
>   JG: It's hard to tell when those problems will be resolved. The
>   Linux community has got itself into a bit of a pickle. I think they
>   could have avoided it, but it's now going to take time, and it'll be
>   a painful thing for them. They're going to go from being a bunch of
>   hobbyists having a good time to developing mission-critical
>   applications. The road may be a little bumpy.
>
>Does anyone have any clue what Gosling is talking about? I guess the
>native threads problems could have something to do with Linux
>versions, but the green threads versions seem awfully portable to me
>and are just fine for most use.
>
>My feeling is still that the real problem with Java and Linux is that
>it's a problem of Sun politics, not technology. So I was quite
>surprised to see Gosling vaguely endorse the idea.
>
>   [EMAIL PROTECTED]
>.   .  . ..   .  . . http://www.media.mit.edu/~nelson/
>
>
>--
>To UNSUBSCRIBE, email to [EMAIL PROTECTED]
>with a subject of "unsubscribe". Trouble? Contact 
>[EMAIL PROTECTED]
>

__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: Problem with JNI_CreateJavaVM()

1999-09-20 Thread jools enticknap



Hi

Add the JNIGetDefaultJavaVMInitArgs, plus you need to
add your class path to vm_args.classpath



I have a C++ class which does all this for you, email me off list
and I'll send it to you.

Regards

--Jools




>From: Pierre Heroux <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Problem with JNI_CreateJavaVM()
>Date: Mon, 20 Sep 1999 17:54:51 +0200
>
>I have a "Segmentation fault (core dumped)" message when I execute the
>following source.
>
>#include 
>#include 
>
>int main()
>   {
>   const int nOpts = 4;
>   JavaVMOption options[nOpts];
>   int ii=0;
>   options[ii++].optionString = "-Djava.compiler=NONE";
>   options[ii++].optionString = "-Djava.class.path=.";
>   options[ii++].optionString = "-Djava.library.path=.";
>   options[ii++].optionString = "-verbose:jni,class,gc";
>
>   JavaVMInitArgs vm_args;
>   vm_args.version = JNI_VERSION_1_2;
>   vm_args.options = options;
>   vm_args.nOptions = nOpts;
>   vm_args.ignoreUnrecognized = JNI_TRUE;
>
>   JavaVM *jvm;
>   JNIEnv *env;


JNI_GetDefaultJavaVMInitArgs( &vm_args );




>   jint res = JNI_CreateJavaVM(&jvm, (void **)&env, &vm_args); /*debugger
>message : Program received signal SIGSEGV, Segmentation fault.
>0x401d5ca8 in main_arena ()*/
>   if(res < 0)
> {
> cerr << "Can't create Java VM" << endl;
> exit(1);
> }
>   cout << "JNI_CreateJavaVM() is OK" << endl;
>   jvm->DestroyJavaVM();
>   }
>
>g++ -g simple.cpp -L/usr/local/jdk/jre/lib/i386
>-L/usr/local/jdk/jre/lib/i386/classic
>-L/usr/local/jdk/jre/lib/i386/native_threads -ljava -ljvm -lpthread
>-lhpi -o Simple
>Simple
>
>I use java version "1.2"
>Classic VM (build Linux_JDK_1.2_pre-release-v2, native threads, nojit)
>on RedHat5.2
>
>
>Thanks a lot,
>Pierre
>
>
>
>
>--
>To UNSUBSCRIBE, email to [EMAIL PROTECTED]
>with a subject of "unsubscribe". Trouble? Contact 
>[EMAIL PROTECTED]
>

__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: debuggers for Java-JNI-C++

1999-09-21 Thread jools enticknap


Hi

I was hoping that somebody might come up with a better solution to the one I 
currently use ( as it's very flaky ) so I though I'd post the way I debug 
JNI on Linux.

1) Get a copy of ddd. ( Plase don't post messages as to how you get it, 
it'll just piss of the rest of the guys )

2) Using the jdb feature of the debugger, start your application and place a 
break point on your native method.

3) When you hit the break point, startup another ddd session except use the 
attach feature to debug the (green) java program.

4) Set a breakpoint in your JNI code.

5) press the cont button on the C/C++ debug session.

6) press the cont button the Java session.


Yeah yeah yeah, I know its not great, but it works most of the time :-(

Or you could write you own program which loads the virtual machine and just 
use ddd on that, setting a breakpoint in your shared library or what 
ever.


Best regards


--Jools




>From: Paul Beardsley <[EMAIL PROTECTED]>
>To: Juergen Kreileder <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED]
>Subject: Re: debuggers for Java-JNI-C++
>Date: Tue, 21 Sep 1999 12:07:43 -0400 (EDT)
>
>
>OK, but I'm running Java 2 SDK so I think I don't have
>access to a java_g - is there an alternative
>approach for Java 2?
>
>Paul.
>
>
>Juergen Kreileder writes:
>  >
>  > Paul> Thanks, but how do I do that first step of
>  > Paul> running a JVM under Java - is there a C
>  > Paul> executable somewhere that runs a JVM,
>  > Paul> so that I can gdb that executable?
>  >
>  > $ DEBUG_PROG=gdb java_g
>  > ...
>  > (gdb) run 
>  >
>
>
>--
>To UNSUBSCRIBE, email to [EMAIL PROTECTED]
>with a subject of "unsubscribe". Trouble? Contact 
>[EMAIL PROTECTED]
>

__
Get Your Private, Free Email at http://www.hotmail.com


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



OT Re: Class information in a static method

1999-10-07 Thread jools enticknap

>This might be slightly off topic, but I really need help with this.
>
>Is there any way to obtain the Class-instance associated with the current 
>class in a static method? Obviously, this.getClass() doesn't work ;)
>

If the class is call com.blah.Stuff, use com.blah.Stuff.class; to get the 
java.lang.Class for a class.

eg.

package com.blah;

class Stuff {
public static void doIt()
{
 Class c = com.blah.Stuff.class;

}

}

Regards

--Jools

__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: Const in java

1999-10-13 Thread jools enticknap


Hi Robert,

Adding the final keyword to a variable in an argument list only
means that the reference is final, ie you can't make the reference refer to 
another object. I does not mean that I can't call certain methods in the 
same way as C++.

Regards

--Jools

>From: "Robert Simmons" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject: Const in java
>Date: Wed, 13 Oct 1999 15:54:26 -0600
>
>I was always the real proponent of type and instance safety in c++. for 
>example.
>
>class Foo {
>   private BarClass  _bar;
>
>   public const BarClass& getBar();
>   public setBar(const BarClass const &bar);
>}
>
>This snippet guarantees that someone doesnt pull a getBar() then set the 
>return result. ie:
>
>void main {
>Foo f = new Foo();
>BarClass c = new BarClass();
>BarClass b = g.getBar();
>b = c;  // DOH we just changed bar inside of the f instance
>}
>
>Also it guarantees the following cant happen:
>
>Foo::setBar(const BarClass const &bar) {
>   bar = new BarClass();  // DOH, just overwrote the var outside the method
>}
>
>Since everything in java is passed by reference this becomes even more of 
>an issue.
>Therefore can I do the following to achieve the desired safety ?
>
>class Foo {
>   private BarClass  _bar;
>
>   public final BarClass& getBar();
>   public setBar(final BarClass bar);
>}
>
>Thanks for your time.
>
>--rob

__
Get Your Private, Free Email at http://www.hotmail.com


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



Re: JDBC for mysql?

1999-10-15 Thread jools enticknap


Hi Brian

There are two available drivers for MySQL.

http://www.tcx.se/Contrib/

Look for JDBC. :-)

I use the mm.mysql driver, the twz driver seems to be a little overkil.

Best regards

--Jools

P.S.

If you have any Linux JDBC questions, TCX have there own mailing list, I 
suggest that you join it !






>From: Brian Gilman <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: JDBC for mysql?
>Date: Fri, 15 Oct 1999 00:46:41 -0400
>
>Hello all!
>
>   although this is not *exactly* a java Linux question, I
>believe it is close enough.Can someone point me to a mysql driver
>for jdbc? Thanks in advance!
>
>   sincerely,
>
>   Brian Gilman
>-BEGIN PGP PUBLIC KEY BLOCK-
>Version: PGPfreeware 6.5.1 for non-commercial use 
>
>mQENAzfgDVUAAAEIALTF+F7yvAThOGDVYagMf8wL8ZWjTNn9xzY9t8OBWyQwJO6b73ozK6
>nA148NhNkxGLBgH0FVZ3EHOW5Fxvjc6/TYuUPXjJ4R3o6HxyM/wbWYH/Hjz7kgIYdKQBBH
>bhvaVzWuNfjqsnsB9fp2bkG+rlDM7CKyZQc23Kwgrk7rqyaBBBzgwom7fXZVjnGoIqCmLS
>B3je/HgbC5l0EHsSFxKbhF904R0HCEaYcVksSjbsATW1Qu0L5t0hMAsiitQ5/ToXFYWFwx
>7AexVHPHzWOZ8VZQUxmfi5v00r27MdffXH/mqipvKEGl1TIxpo71Pm5dbfAJrw5X6t2vv7
>IOmfw4INEABRG0JkJyaWFuIEdpbG1hbiA8Z2lsbWFuYkB2dXNlci51bmlvbi5lZHU+iQEV
>AwUQN+ANVb+yDpn8OCDRAQEtUQf/T9dMe4iW9885Om0KrzvcFwmYcHKEBc4ykwEPH0+J2C
>sjA9lWpU03CIIY+t/omuw5GcArildpZYFB0S145+90APVg6dsRF6b2Kuw7FMPdL8Yz7vWi
>vjT/2rhHsvYBAQmcsrLrPjhfyD0kTByg/CUSp2rVAbmR54zUsMXe6bDdleOW4rGo+jepf6
>J1TsCXEFzbym1nFX5aZ9oU8KtfQky8/E85z7JdDvDNC0nC5jWPwGpyrUNrpCWN+TQSpQFP
>xNrqrTU19X4+Oe1Gyzyf363tUsS/jMnvAKOLkWsI4k75wY/HHTvn0lq3GWeRwj2BJLeihG
>XvaiWEi3lRwCKiGUZKKg===wwNh
>-END PGP PUBLIC KEY BLOCK-
>
>
>--
>To UNSUBSCRIBE, email to [EMAIL PROTECTED]
>with a subject of "unsubscribe". Trouble? Contact 
>[EMAIL PROTECTED]
>

__
Get Your Private, Free Email at http://www.hotmail.com


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