I am interested in getting a Parser Generator written in Java,
to work on an old MacOS 9 computer. Since it is a Java command line tool,
I've written a small Graphical Shell in Java, that set up Commandline
Parameters for the Main Class in the tool.
Since I'm not satisfied with the Java shell, I wan't to rewite it with
C++/PowerPlant. This requires instantiating and calling a Java Virtual
Machine.
Do anyone know where I can find an Example of how to do this?
The Java Native Interface examples bundled with Pro 5 is useless for this
purpose.

Signature
Tommy Nordgren <nordgren.tommy@telia.com>
<http://w1.866.telia.com/~u86627430/>
Torstenssonsgatan 7A,2Tr,114 56 Stockholm
SWEDEN
+ 46 8 662 88 04
bolsinga@hotmail.com - 01 Feb 2004 16:30 GMT
>I am interested in getting a Parser Generator written in Java,
>to work on an old MacOS 9 computer. Since it is a Java command line tool,
[quoted text clipped - 6 lines]
>The Java Native Interface examples bundled with Pro 5 is useless for this
>purpose.
For JNI on Mac OS 9, that example is probably your best best. Otherwise you may
be able to examine the Mozilla source for Mac OS 9.
What is wrong with the example given? What doesn't it do that you need it to do?
Tommy Nordgren - 01 Feb 2004 17:32 GMT
in EQ9Tb.8554$zv2.8158@newssvr29.news.prodigy.com, on 04-02-01 17.30,
>> I am interested in getting a Parser Generator written in Java,
>> to work on an old MacOS 9 computer. Since it is a Java command line tool,
[quoted text clipped - 13 lines]
> What is wrong with the example given? What doesn't it do that you need it to
> do?
The examples bundled with CW Pro 5. Shows how to write native classes
callable from Java.
There is nothing that shows how to instantiate a Java Virtual Machine,
call the Main Method of the tool & handle callbacks.

Signature
Tommy Nordgren <nordgren.tommy@telia.com>
<http://w1.866.telia.com/~u86627430/>
Torstenssonsgatan 7A,2Tr,114 56 Stockholm
SWEDEN
+ 46 8 662 88 04
bolsinga@hotmail.com - 01 Feb 2004 18:33 GMT
>> For JNI on Mac OS 9, that example is probably your best best. Otherwise you
>> may
[quoted text clipped - 7 lines]
>There is nothing that shows how to instantiate a Java Virtual Machine,
>call the Main Method of the tool & handle callbacks.
Ah, I could swear I remember a JManager example on there.
<http://developer.apple.com/documentation/macos8/LegacyJava/LegacyAPI/JManager/JM
anager.html>
JManager is needed to do JNI on Mac OS 9. It is not needed (and not available) for Mac OS X.
If you look in the Mozilla source base for the Mac OS 9 java source, you'll see how to do it.
On Mac OS X, it's much easier because you just use standard JNI.
johnny lai - 03 Feb 2004 05:19 GMT
Why not just use one of the exec() system calls? ie. Just call the java
program from the command line from your C++ GUI?
Johnny
> I am interested in getting a Parser Generator written in Java,
> to work on an old MacOS 9 computer. Since it is a Java command line tool,
[quoted text clipped - 6 lines]
> The Java Native Interface examples bundled with Pro 5 is useless for this
> purpose.
Thomas Engelmeier - 10 Feb 2004 23:42 GMT
> Do anyone know where I can find an Example of how to do this?
> The Java Native Interface examples bundled with Pro 5 is useless for this
> purpose.
You can use pretty much every standard JNI sample about instantiating a
JVM - the code I used works with some Java 1 / Java 2 conditional
defines with MacOS 9, MacOS X and Win32.
Additionally, you probably need the MRJ SDK which hopefully is still at
Apples website in order to get jni.h and the according MRJ / JVM / JNI
library. The only thing special on OS 9 is that it is a pretty good idea
to call some cooperative idle routine from you C++ event loop so the JVM
gets time e.g. for networking etc..
IIRC MacTech had some article how to do it, so it might be on the
mactech.com website.
regards,
Tom_E

Signature
This address is valid in its unmodified form but expires soon.