Someone on the jython mailing list sent me this. I haven’t been able to
decypher it yet but it seems that what we’re trying to do is possible.
It doesn’t want awt classes. It allows ACCESS to them. That is very
powerful because now I can write in python and use/inherit from java
classes. I’m not sure how the internal mechanism works though. In
general,
in jython, one should just be able to write a program like:
import java
from java import awt
def exit(e): java.lang.System.exit(0)
frame = awt.Frame(‘AWT Example’, visible=1)
button = awt.Button(‘Close Me!’, actionPerformed=exit)
frame.add(button, ‘Center’)
frame.pack()
in python. What blows up with j9 on RTP is the “import java” part - it
claims it can’t find the module.
cheers,
Kris
“Andrew Sandstrom” <> andrew_sandstrom@oti.com> > wrote in message
news:> 3c61ca60.31689577@inn.qnx.com> …
I’m not familiar with jython yet (waiting on our software police to
give me approval to download).
However, if it is looking for awt classes,try looking for file
ive/lib/jclMax/prsnlnto.jar. If you don’t have this, you can try
downloading the “Personal Configuration” technology from
www.embedded.oti.com> . Follow the install instructions for unzipping
over an existing j9 release.
When you run, use a command line like this
j9 -bp:/ive/lib/jclMax/classes.zip:/ive/lib/jclMax/prsnlnto.jar …
(the trick about finding jclMax/classes.zip by default will not work
once you have to add the awt implementation to the bootclasspath.
It does seem odd that they want awt classes. I heard from a colleague
that it might be doing dynamic class creation. That could be
inserting an interesting twist.
-Andrew
On Wed, 6 Feb 2002 10:41:07 -0500, “Kris Warkentin” <> kewarken@qnx.com
wrote:
Actually, just as a straight python interpreter, it seems to work fine.
It’s just pulling in java classes that fails.
The steps I followed were these:
- Run the installer on windows box to extract all the stuff to
jython-2.1
directory.
- Copy jython-2.1 directory to RTP box.
- Setup script in my path with variables pointing to appropriate
places.
BTW, the j9 line is only one line - looks like formatting of the
message
might have wrapped it. Andrew Sandstrom had mentioned that as long as
the
binary for j9 can find …/lib/jclMax/classes.zip (relative to itself),
you
don’t need the -bp:/opt/vame/ive/lib/jclMax/classes.zip in the command
line.
I’m wondering if we need to set something more in order to get jython
to
find the java classes.
cheers,
Kris
“Armin Steinhoff” <a-steinhoff@web_.de> wrote in message
news:3C60F44E.B824CBB6@web_.de…
Kris Warkentin wrote:
Well, I’m not thrilled yet…I can’t seem to get access to java
classes
from
within jython. Something like ‘import java.awt’ complains about not
finding
a java module.
Strange … I wonder why AWT is used for a command line interpreter.
What happens if you don’t import this module?
I have tried to use your script without success and see always the
response
java.lang.NoClassDefFoundError: org.python.util.jython a.s.o …
Do you have installed the source tar ball?
However … I will try under LINUX to strip down jython to a version
which doesn’t use AWT.
Thanks
Armin
cheers,
Kris
“Armin Steinhoff” <a-steinhoff@web_.de> wrote in message
news:3C604662.D3A88FE4@web_.de…
Hi Kris,
that’s great … I will try in the next weeks to get Harness
running
( > http://www.mathcs.emory.edu/harness/HARNESS/proto.html
http://www.csm.ornl.gov/harness > )
Thanks a lot for that good starting point
Regards
Armin
Kris Warkentin wrote:
Well, I got it running…I didn’t get the installer to work
but
running
the
already extracted stuff worked. Here’s a script:
#!/bin/sh
JYTHONDIR=/export/home/kewarken/jython-2.1
j9 -Dpython.home=$JYTHONDIR -cp:"$JYTHONDIR/jython.jar:$CLASSPATH"
org.python.util.jython $*
I haven’t tried the demos yet but this gives me an interpreter
shell.
cheers,
Kris
“Armin Steinhoff” <a-steinhoff@web_.de> wrote in message
news:3C5FDE22.B166D@web_.de…
Andrew Sandstrom wrote:
On Fri, 1 Feb 2002 19:08:12 -0500, “Kris Warkentin”
kewarken@qnx.com
wrote:
I wonder why
j9 is such a pain in the butt?
“Ahm, it’s like a new pair of underwear, you know… At
first
it’s
constrictive, but after a while it becomes a part of you.”
Well … and after a while of trying and testing that ‘new
pair
of
underwear’ we have probably to recognize that j9 has so many
restrictions that it is not useful for the next generation of
distributed embedded control systems … which means we could
forget
QNX6.1 and MUST use one of these RT LINUX systems as a test
bed
together
with SUN JAVA.
BTW … JYTHON is not a desktop application … it is PYTHON
written in
pure JAVA. Is all what can’t be used with j9 for you a
desktop
application ?
Garth Algar, “Wayne’s World”
Andrew >
It’s hard to smile if you are standing around wearing only a
pair
of
underwear >
Armin
\