aspose file tools*
The moose likes Jython/Python and the fly likes Jython with JDK1.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Jython/Python
Bookmark "Jython with JDK1.5" Watch "Jython with JDK1.5" New topic
Author

Jython with JDK1.5

Josh Juneau
Ranch Hand

Joined: Jun 16, 2004
Posts: 86
Has anyone successfully compiled Jython code under JDK 1.5? I am using Jython with the JDK, however, if I attempt to compile Jython code using jythonc I receieve a slew of errors pertaining to ClassNotFoundExceptions. Yes, my classpath is correct with all of the necessary jars to run and compile the code...that is why I believe that JDK 1.5 may be causing the issue.

Any thoughts?

Thanks!


Database Administrator/Application Developer
could rangers
Greenhorn

Joined: Jan 16, 2005
Posts: 4
jythonc works only at jdk 1.1 and 1.2,
perhaps on 1.3 is ok too.
But on 1.4 and above,
jythonc doesn't work,
jdk 1.4 has a key word "assert",
and jdk 1.5 makes the word "enum" as a keyword too.
jython 2.1 is released in 2001,
4 year passed, and not upgraded at all,
perhaps it will never be upgrade,
because the author is now working at ironpython(python on .net) in microsoft.
if you want both the convenience of python and power of java,
try groovy.
Norm Miller
Ranch Hand

Joined: May 21, 2002
Posts: 56
Just one correction to previous responder: Jython IS being worked on again. Brian Zimmer has received a grant to finance a major upgrade this year. You can Google search "Jython sf" to find the latest info.
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
I wonder if we need jython, if groovy ships a stable release?. I'm not aware of the implementation differences between jython and groovy.
But i guess groovy's integration with jvm is better and groovy has copied most if not all of python's features.They have copied stuff from ruby as well
I feel groovy is probably closer to ruby than python. I wonder if we can build GroovyOnRails if there is a lot of truth to RubyOnRails hype.
could rangers
Greenhorn

Joined: Jan 16, 2005
Posts: 4
Originally posted by Norm Miller:
Just one correction to previous responder: Jython IS being worked on again. Brian Zimmer has received a grant to finance a major upgrade this year. You can Google search "Jython sf" to find the latest info.


thanks. It was only two day ago that I got to know Jython is live again. They plan to ship a stable realse in July this year. Looking forward to the day.
could rangers
Greenhorn

Joined: Jan 16, 2005
Posts: 4
Originally posted by Karthik Guru:
I wonder if we need jython, if groovy ships a stable release?. I'm not aware of the implementation differences between jython and groovy.
But i guess groovy's integration with jvm is better and groovy has copied most if not all of python's features.They have copied stuff from ruby as well
I feel groovy is probably closer to ruby than python. I wonder if we can build GroovyOnRails if there is a lot of truth to RubyOnRails hype.


Definitely we need Jython. Groovy is just groovy, though it has a few advantages which python has not, but it's still not as convenient as python sometimes, e.g, groovy can't add and delete properties or functions to a class at runtime. this is very useful.

And groovy use "{}" as java does, it's code will not be as short as
python does. Java programmers will like groovy, but pythoners will prefer Jython.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Originally posted by Karthik Guru:
I wonder if we need jython, if groovy ships a stable release?. I'm not aware of the implementation differences between jython and groovy.


More realistically: why do we need Groovy when we have Jython?
Why YASL?
Sure Jython needs updating but it seems the project is going forward. Maybe it's time more people got on board of course to prevent stagnation from setting in again.


42
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
Originally posted by Jeroen Wenting:


More realistically: why do we need Groovy when we have Jython?
Why YASL?


Yup true. But this is just like jsf vs tapestry debate except that here groovy is not inferior to python, given that it borrows heavily from both python and ruby. There might be something missing here and there. But then Python does not have optional static typing while groovy does. To me it appears that jython folks were not smart enough to gather support from sun. I wish they had.

I was just playing around and did something as simple as this..

In Jython -



While in Groovy -



So groovy is java. But jython is'nt. I guess it is something
else because it needs to be python too?.
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
I also strongly believe that jython is definitely relevant to python -> java converts. But I wonder if its the same for the majority of the masses that start off their career with java?. Here we have a language that sun has accepted and has a jsr. I guess it does makes a huge difference when to comes to adoption by the community.

So that makes me wonder if jython will remain relevant because jython ultimately exists to lend python's productivity gains to a java programmer.

Groovy made the first jsr release today btw.
M Beck
Ranch Hand

Joined: Jan 14, 2005
Posts: 323
Karthik, the reason your Jython does that is that you've stumbled on an artifact of ancient Python history - "old-style" classes. do this instead:

notice the list (well, tuple) of superclasses in the class definition. this tells Python to make a "new-style" class, and the inheritance tree for all such is rooted in "object".

if your class does not specifically list the class(es) it inherits from, then it will be made an old-style class by default. if your class inherits from any old-style class, then it will also be made an old-style class, by necessity. but there are no longer any old-style classes in the Python standard library, so for this to be a concern, you'd have to either extend a class defined in ancient code or deliberately write a brand-new old-style class. (your example code did the latter, surely by mistake. right? )

in this day and age, "old-style" classes in Python are decidedly deprecated, and only kept around for compatibility with truly ancient code. i suspect they may one day be removed from the language; watch for the ChangeLog when Python 3.0 is released.

now, Java programmers might perhaps be annoyed that they have to explicitly specify that their classes extend "object". but remember, in Python, "explicit is better than implicit" - the only real problem, from a Python point of view, is that the non-explicit syntax (for now, anyway) gets you an entirely different behaviour, without warning. if not for backwards compatibility, most likely you wouldn't be allowed to write a Python class that didn't spell out which class(es) should be its parent(s).
[ April 06, 2005: Message edited by: M Beck ]
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Groovy might be a JSR but Python has acceptance among users...

Groovy doesn't seem to be going anywhere btw, development was at a standstill last time I checked about 2 months ago.
Most members seemed to have abandoned the project after some serious infighting.

A JSR of course doesn't mean it gets included in the language, and happy for it. IMO a scripting language shouldn't be a core language component of any programming language...
Most JSRs in fact never get past the first stages, which is where Groovy is happily stuck right now.
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
Originally posted by M Beck:

now, Java programmers might perhaps be annoyed that they have to explicitly specify that their classes extend "object". but remember, in Python, "explicit is better than implicit"


Ok I can live with this , i mean explicitly specifiying the Object class in the hierarchy except that i dont buy the 'explicit is better than implicit' argument in this case . Its perfectly fine to expect me to be explicit in the face of ambiguity. But there isnt anything ambiguous about java class having a single rooted hierarchy. Its a python issue that it does'nt have Object at the root by default (ok now it is fixed ) but it expects me as a java programmer to be explicit.

Please dont misunderstand me. I like python. I'm just wondering if java community needs to be looking at something outside the community for scripting language support.
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
Its been just about 2 months since I started looking at groovy. They have had 2 releases since then. I seriously have no idea if the people who left were influential guys. Some guys, alteast the creator, must be around otherwise how did they make a release just couple of days back. If the fighting was about syntax/features , then i wonder how everybody can be satified. There has to be someone , the lead , who needs to intervene and get on with it and people who disagree may choose to leave. I think that is fine. People have issues with java too. I have run into presentations by influential schemers that find python very amusing. That hasnt stopped me / others from learning python.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Jython with JDK1.5