Prior to January 2019, customers paid Oracle for a Java Standard Edition (SE) license plus annual support, and updates were provided for free. Starting February 1, 2019, Oracle now requires businesses to have a commercial license in order to get updates for Java SE, resulting in significant changes to their subscription model. This news has caused many businesses to start evaluating their current Java usage, as well as their options going forward.
ActiveState and OpenJDK
ActiveState has a 20 year history in helping organizations run open source languages like Perl, Python and Tcl, and even Go and Ruby, within their enterprise, but we’re not blind to the fact that most enterprise applications are built on Oracle’s Java. The open source alternative to Java, OpenJDK is certainly alive and well according to Red Hat’s Andrew Haley, and a viable option for those that feel the need to switch.
But commercial support options for OpenJDK are limited. Red Hat has a history of offering Red Hat Enterprise Linux (RHEL) support for OpenJDK and (as of Dec 2018) Windows support as well, but there are few vendors supporting Mac, other Unix versions, or big iron platforms like AIX or Solaris. Given this situation, and in response to a number of inquiries, ActiveState is currently evaluating whether an offering for OpenJDK may be a viable addition to the open source languages currently available on the ActiveState Platform. If you’re interested, let us know.
Time for Python?
With the rise of Machine Learning (ML), Python has become one of the industry’s most popular programming languages. While we’re certainly not recommending replacing your Java application with a Python application, it may be time to consider Python as a viable alternative for new applications.
Introducing Python to a Java shop is a non-trivial exercise, but there are a number of ameliorating factors, including:
- Good development practices are widely applicable to any language.
- The languages themselves have more differences than similarities, but:
- Both run on virtual machines.
- Both languages support objects and classes.
- Syntax structures like case sensitivity, operator assignment and comparison operators are identical.
- The dev infrastructure you have in place is widely reusable. For example:
- Code repositories like Git and Subversion work just as well with Python as Java
- Binary repositories like Sonatype Nexus and JFrog Artifactory support integration with the Python Package Index (PyPI).
- If you have Jenkins in place for continuous integration, it can seamlessly be extended to work with Python.
- Many of the Java tools you’re currently using are largely language agnostic or provide similar levels of functionality and support. For example:
- Java IDEs like Eclipse & IntelliJ provide plugins for Python.
- Popular code quality tools like SonarQube work with both Java & Python.
- Testing automation tools like Selenium have been adopted by the Python community, which has created an interface to it that can be found on PyPI.
Moving from Java to Python
To get started, you’ll want to take a look at a number of resources that are aimed at easing Java developers into the warm bath of Python programming, such as:
- On Moving from Java into Python – Good, high level overview that focuses on the programming concepts that differ between Java and Python, and calls out the key errors that Java devs tend to make when starting to code in Python.
- Learn Python in 60 Minutes from Java – An excellent video tutorial that juxtaposes Java code (in Eclipse) and Python code (in Pycharm) to show exactly how the two languages differ when coding a similar solution. Master the basics in literally 1 hour.
- From Python to Java – Don’t let the title confuse you – this resource is just as useful for moving from Java to Python, providing a juxtaposition of Java and Python code, along with brief, to-the-point explanatory text on the differences.
- Python for Java Programmers – Provides a good, practical introduction to Python programming from a Java developer’s point of view, with many code examples.
- From Java to Python – Overcoming the Stockholm Syndrome – A slide deck summarizing one programmer’s journey from Java to Python, and the key takeaways he discovered (both good and bad) along the way. With code examples.
- Converting Java Code to Python – Sometimes the best way to start programming in a new language is to by converting your existing code so you can see what it looks like. It’s not perfect, and works best with simpler Java code, but java2python can help you kick start your learning.
Sourcing Python
Finally, you’ll need to choose a Python language distribution to start learning with. While most developer’s operating systems already come with a community distribution of Python, they tend to include little more than just the core language. Vendor-supported archives, like ActiveState’s Python (ActivePython) distribution include not only the core language, but also many of the most popular community-created libraries, allowing you to explore both the language and its ecosystem.
To get started on your Python journey, you can:
- Download ActivePython, or
- Build your own Python distribution with just the packages you need by creating a free ActiveState Platform account.