Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Question about Jython usage in eclipse plugin

Brian H
2010-06-29
2013-03-15
  • Brian H
    Brian H
    2010-06-29

    Hi,

    I am using Pydev 1.5.7 and I am working on an eclipse plugin that will be making Java calls to Jython.  I added the Pydev plugins in the manifest file under dependencies (including org.python.pydev.jython).  This works but it seems that Pydev uses an older version of Jython (perhaps 2.2) by default.  How can I use a different version of Jython?  Is there a way to configure this? 

    thanks,
    brian

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2010-07-01

    Hi Brian,

    For that to work, you'd have to do your own plugin similar to the org.python.pydev.jython plugin. Still, I'm not sure if you'll be able to depend on the org.python.pydev.jython plugin and on your own plugin as the imports will be the same for the same classes (as it's jython but only a different version).

    If you didn't depend on pydev, that should work (although I didn't really test if it works having different plugins with the same namespaces).

    The internal version for pydev is Jython 2.1 (yes, it's a bit old). I was thinking on updating, but didn't want to double the download size of pydev at the time just to get a newer Jython (I did take a look at it and with some work it can get smaller again, but still didn't get time to go through that).

    If you want, an option would be checking the latest jython release and making it smaller again (I had written to the jython list at the time at: http://permalink.gmane.org/gmane.comp.lang.jython.user/8459 ). If you're able to get it smaller again, there'd be no problem upgrading the jython pydev is using (so, you could keep using it and not worrying about having a secondary plugin with jython).

    Cheers,

    Fabio

     
  • Brian H
    Brian H
    2010-07-01

    Fabio,

    What I did was to replace the version of jython.jar in the pydev installation with a newer version (jython 2.5.1) and then i also replaced the other libraries that came with jython.  In limited testing, this seemed to work.  Do you think this is safe or am i missing something?  You mentioned making it smaller…is this a requirement or just to avoid having such a big package?

    I guess you are saying I could just use the jython jar files and not use the python plugin version.  This would work but its convenient to have an actual plugin so I would like to go with that if possible.

    Anyway, thanks for such a great tool!  It's the best python development tool I have used.

    brian

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2010-07-01

    You can in your installation change the jython jar, and the  Jython Lib in pydev (should be safe).

    The only problem should be the size of things (and maybe doing some testing to see if some pydev script broke - although in theory as it's backward compatible, all should work)..

    Cheers,

    Fabio