views:

430

answers:

3

Hello everyone,

I want to develop a Java application mixing java with jython. I am using the IDE Netbeans with the python plugin. How do i work on this? (There is a built in support for Groovy with javaSE from IDE call Groovy classes from Java code, and Java classes from Groovy code but not for jython)

ref: http://www.netbeans.org/features/groovy/index.html

+2  A: 
Ben Hoffstein
But how does setting the runtime help developing Java application that mixes Java and Jython?
Joonas Pulakka
+1  A: 

I would also want to add that since 6.5 release, the Python bits have been vastly improved upon. So, if you want to try the new but unstable builds, please grab one from http://deadlock.netbeans.org/hudson/job/python/

Also, please refer to various documents linked from http://wiki.netbeans.org/Python and my blog posts at http://amitksaha.blogspot.com/search/label/nbpython

In case of problems, please let us know on the mailing list.

Amit
I am using 6.7m2, for groovy they are modifying the ant build script with groovyc compiler enabling it from properties window. how we can do that with jython ?
Sridher
Do what? Please be a bit more concrete..
Amit
+1  A: 

If you want to develop a Java application that blends with Jython and works outside NetBeans, then NB's ability to use Jython runtime doesn't help much. Instead, you have basically two choices:

  • You can compile your Python to Java classes using jythonc.
  • Or: you can embed the Jython interpreter inside your Java app.

To embed, you need to create a Jython library to be included in your Java app. Do this by going to Tools -> Libraries, select New Library, and add the stuff at NetBeans' Jython directory there (C:\Program Files\NetBeans 6.5\python1\jython-2.5 in my machine). You need jython.jar and at least most of the stuff at the javalib directory.

Joonas Pulakka
Exactly, if your looking to combine code with the flexibility of groovy your not going to have much luck.
James McMahon