DEV Community

Podcast.__init__

Power Up Your Java Using Python With JPype - Episode 286

Summary

Python and Java are two of the most popular programming languages in the world, and have both been around for over 20 years. In that time there have been numerous attempts to provide interoperability between them, with varying methods and levels of success. One such project is JPype, which allows you to use Java classes in your Python code. In this episode the current maintainer, Karl Nelson, explains why he chose it as his preferred tool for combining these ecosystems, how he and his team are using it, and when and how you might want to use it for your own projects. He also discusses the work he has done to enable use of JPype on Android, and what is in store for the future of the project. If you have ever wanted to use a library or module from Java, but the rest of your project is already in Python, then this episode is definitely worth a listen.

Announcements

  • Hello and welcome to Podcast.__init__, the podcast about Python and the people who make it great.
  • When you’re ready to launch your next app or want to try a project you hear about on the show, you’ll need somewhere to deploy it, so take a look at our friends over at Linode. With the launch of their managed Kubernetes platform it’s easy to get started with the next generation of deployment and scaling, powered by the battle tested Linode platform, including simple pricing, node balancers, 40Gbit networking, dedicated CPU and GPU instances, and worldwide data centers. Go to pythonpodcast.com/linode and get a $60 credit to try out a Kubernetes cluster of your own. And don’t forget to thank them for their continued support of this show!
  • You listen to this show to learn and stay up to date with the ways that Python is being used, including the latest in machine learning and data analysis. For more opportunities to stay up to date, gain new skills, and learn from your peers there are a growing number of virtual events that you can attend from the comfort and safety of your home. Go to pythonpodcast.com/conferences to check out the upcoming events being offered by our partners and get registered today!
  • Your host as usual is Tobias Macey and today I’m interviewing Karl Nelson about JPype, a language bridge that lets you use Java classes in your Python programs

Interview

  • Introductions
  • How did you get introduced to Python?
  • Can you start by giving an overview of what JPype is?
    • What was your motivation for becoming such a regular contributor to the project?
  • Why might someone want to be able to call into the Java ecosystem from a Python program?
  • There have been a number of other projects aiming to combine the capabilities of Java and Python, such as Jython and PyJNIus. What are the relative tradeoffs between the different options?
    • Many of those other projects have stalled or stopped altogether. What about JPype has allowed it to survive for so long?
  • Can you explain how JPype is implemented?
    • How has the design and implementation of the project evolved since it was first implemented?
    • How do the relative language versions influence the compatibility of programs on either side of the bridge?
  • What is involved in creating a project that uses JPype?
    • How are dependencies, packaging, distribution, etc. handled across the Java and Python portions of the code?
  • What are some of the ways that JPype can be used for Android applications?
  • What are some of the sharp edges or pitfalls that users of JPype should be aware of?
  • What are some of the most interesting, innovative, or unexpected ways that you have seen JPype used?
  • What have you found to be the most interesting or challenging aspects of building JPype?
  • When is JPype the wrong choice?
  • What is in store for the future of the project?

Keep In Touch

Picks

Links

The intro and outro music is from Requiem for a Fish The Freak Fandango Orchestra / CC BY-SA

Episode source