If you want to take advantage of rich set of java libraries but, without leaving your favorite language Python. You have couple of options.
1. JPype - http://jpype.sourceforge.net/
2. Jython - http://www.jython.org/
Both the above projects allow to call Java code using Python syntax. But, there is distinction how they achieve this.How they are implemented ?
JPype is implemented as module in CPython. So all you need to do is install JPype package and you are ready to go. On the other hand Jython is a implementation of Python language syntax using Java. Both, have their advantages.Which one should I pick ?
JPype is a suitable candidate if your application depends on lots of other external Python packages that are not available in Jython world. Like, for example you have an application built using PySide/PyQt and you want to call some java functions from within that application. Then, JPype is your best bet. This way JPype offers you best of the both worlds Python and Java.
If you want to build your application purely using Java libraries but don't want to leave Python syntax , then Jython helps you out here. As Jython is implementation of Python language specification using Java. Often, it tends to lag behind in terms of features/standard library modules available in CPython implementation of Python. Another use of Jython is, if you have pure java application and you want to bring Python scripting features to it. Then, you can use jython.jar to embed in your program. This will help users to extend you program by writing scripts or plugins.Show me the code
A simple helloworld program example is shown in next post - Simple example using Jython and JPype