j9 and jython ... how to start ?

Andrew Sandstrom wrote:

On Tue, 05 Feb 2002 14:29:06 +0100, Armin Steinhoff
a-steinhoff@web_.de> wrote:

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.

I’m a bit confused about your comment. What do you mean by
“restrictions”?

Well … restrictions are starting with the AWT support. There is only a
so called micro AWT supported based on Photon 1.14 code … correct?

I wonder if j9 fully compliant with J2SE. If not … where are the
deviations documented? (OK … I have now downloaded the LINUX IDE )

My original comment meant to convey the fact that j9
has many options for configuring the VM and class libraries. This
means that just typing “j9” at the command prompt like you do with a
typical desktop JDK install with “java” may not work as expected. But
once you figure out the options, getting j9 to run is no so hard.

Depends on the docs … will look into it.

So I think these “restrictions” would seem to be better for embedded
systems, rather than a big honking wad of J2SE/J2EE.

You mean these restrictions are matching better to small systems … but
the big honking wad of J2SE/J2EE is also be used in (embedded) control
systems.

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 ?


I’m confused again. I don’t think I ever implied that jython was or
was not a desktop application. I checked out jython.org and it looks
like they set their install up assuming a typical desktop JRE. (plus a
couple of others runtimes like blackdown). There would be nothing
preventing them from adding an install section for J9 and giving you
correctly configured scripts.

The question is in what extent is j9 compliant to the rest of the JAVA
world.

Best Regards

Armin

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:

  1. Run the installer on windows box to extract all the stuff to
    jython-2.1
    directory.
  2. Copy jython-2.1 directory to RTP box.
  3. 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 > :slight_smile:

It’s hard to smile if you are standing around wearing only a
pair
of
underwear > :slight_smile:

Armin

On Thu, 07 Feb 2002 15:04:41 +0100, Armin Steinhoff
<a-steinhoff@web_.de> wrote:

Well … restrictions are starting with the AWT support. There is only a
so called micro AWT supported based on Photon 1.14 code … correct?

The Personal Configuration (AWT) is based on PersonalJava level of
AWT, which is approximately JDK 1.1.8. It is based on the QNX 6.1
level of Photon, not Photon 1.1.4

I wonder if j9 fully compliant with J2SE. If not … where are the
deviations documented? (OK … I have now downloaded the LINUX IDE )

J9 focus is currently J2ME. J2SE is tempting because the non-J2ME
“jclMax” + Personal Configuration is close to J2SE. There is javadoc
for each class library set that documents differences.

My original comment meant to convey the fact that j9
has many options for configuring the VM and class libraries. This
means that just typing “j9” at the command prompt like you do with a
typical desktop JDK install with “java” may not work as expected. But
once you figure out the options, getting j9 to run is no so hard.

Depends on the docs … will look into it.

So I think these “restrictions” would seem to be better for embedded
systems, rather than a big honking wad of J2SE/J2EE.

You mean these restrictions are matching better to small systems … but
the big honking wad of J2SE/J2EE is also be used in (embedded) control
systems.

Point taken.

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 ?


I’m confused again. I don’t think I ever implied that jython was or
was not a desktop application. I checked out jython.org and it looks
like they set their install up assuming a typical desktop JRE. (plus a
couple of others runtimes like blackdown). There would be nothing
preventing them from adding an install section for J9 and giving you
correctly configured scripts.

The question is in what extent is j9 compliant to the rest of the JAVA
world.

See http://www.embedded.oti.com/compat/


-Andrew

In article <3C60F44E.B824CBB6@web_.de>, “Armin Steinhoff”
<a-steinhoff@web_.de> wrote:

Strange … I wonder why AWT is used for a command line interpreter.
What happens if you don’t import this module?

Could it perhaps be that it uses the beans get()/set() stuff provided
by awt ?

I had that problem porting the Rhino (mozilla) JavaScript interpreter
to the j9,
i.e. the beans stuff is used to make something like

var x = foo.getBar();

the same as

var x = foo.bar;

in JavaScript.

If that’s the case, it’s easily extracted from Sun’s src distro.

-Th

Good point…if there’s some sort of introspection thing needed by jython to
let people use java classes that is missing in j9…I’ll ask on the jython
developers list and see if anyone has any ideas.

cheers,

Kris
“Thomas Hentschel” <nntp.spam.trap@hentschel.net> wrote in message
news:a3vt16$1q8$1@inn.qnx.com

In article <3C60F44E.B824CBB6@web_.de>, “Armin Steinhoff”
a-steinhoff@web_.de> wrote:


Strange … I wonder why AWT is used for a command line interpreter.
What happens if you don’t import this module?


Could it perhaps be that it uses the beans get()/set() stuff provided
by awt ?

I had that problem porting the Rhino (mozilla) JavaScript interpreter
to the j9,
i.e. the beans stuff is used to make something like

var x = foo.getBar();

the same as

var x = foo.bar;

in JavaScript.

If that’s the case, it’s easily extracted from Sun’s src distro.

-Th

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.

http://www.geocrawler.com/archives/3/7017/2001/8/0/6476573/

cheers,

Kris

“Kris Warkentin” <kewarken@qnx.com> wrote in message
news:a3u6oa$9se$1@nntp.qnx.com

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:

  1. Run the installer on windows box to extract all the stuff to
    jython-2.1
    directory.
  2. Copy jython-2.1 directory to RTP box.
  3. 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 > :slight_smile:

It’s hard to smile if you are standing around wearing only a
pair
of
underwear > :slight_smile:

Armin

\