Java yields to other languages on the Java Virtual Machine

Sun's JVM evolves from being only about running Java apps

Move over, Java. There's more to the Java Virtual Machine than just the Java language these days -- and the field of languages for JVM is growing.

Conceived as a mechanism to provide Java application portability across multiple hardware varieties and operating systems, the JVM now accommodates other languages, ranging from dynamic languages such as JRuby, Jython, and Clojure to the statically typed Scala language. Thus, the JVM is becoming a polyglot platform, where developers can take advantage of different languages for different needs.

The reason the JVM has become so attractive for other languages is the Java platform offers performance and other advantages, says Tim Bray, Sun Microsystems' director of Web technologies. "These days, the JVM, especially HotSpot, has extremely high performance. Second, there's a huge universe of Java libraries. One of the hard problems in getting a new language going is assembling all the necessary libraries to make it useful; on the Java platform you get those for free," he says. Many enterprises also will not deploy anything that does not fit into the Java ecosystem, he notes.

Java the platform taking more prominence than Java the language

Sun's Bray emphasizes that the Java platform is becoming more important than the language itself: "I personally think that the Java platform has more strategic importance than the Java language, going forward."

"The JVM has been absolutely great for us because it really has improved performance very steadily essentially in every new generation," says Martin Odersky, developer of the Scala language. Scala can replace Java in a company's infrastructure, he notes, citing Sony Pictures as a case in point.

Still, JVM proponents do not see the Java language being made obsolete by the increasing use of other languages in the JVM. "Java remains the world's most popular programming language and will be at the core of enterprise and systems programming for the foreseeable future," Bray says.

"If anything like that would happen, it would be in the very, very far future," Odersky says. Java has huge momentum behind it and most companies are reluctant to change, he notes. Still, it is "likely that Scala and some other languages will gain programmer share on the JVM platform and that the platform will become more polylingual than it is now," Odersky adds.

One reason JVM may become more polylingual is Sun's Da Vinci Machine project, which promises to simplify the running of dynamic languages on the JVM. "The Da Vinci Machine work-around [Java Specification Request] 292, designed to make it easier for dynamic-language implementers to get good performance on the JVM, is going to improve the platform's attractiveness to the dynamic language community beyond where it is today. That work deserves close attention going forward," Bray says.

Dynamic languages are good for solving problems where the answer is not necessarily known when starting out, such as in building Web applications, especially because there is no one "right" way to build a Web application, says Clojure author Rich Hickey. By contrast, Java is a good language for implementing another version of a solved problem; lower-level infrastructure apps are particularly suitable for Java, he notes.

Several languages bring better capabilities to the JVM

JRuby and Jython proponents call their languages a supplement to Java, not a competitor. "Jython is much more of a supplement to Java on the JVM," says Frank Wierzbicki, a Jython project lead. "JRuby is definitely a supplement. It is something you can use instead of Java when the situation is right for that. JRuby enhances the Java platform by bringing Ruby to it," says Ola Bini, a JRuby core developer.


JRuby has been the arguably most visible of the dynamic languages riding on the JVM lately. It dates back to 2001 and is an implementation of the Ruby language. "Having Ruby on the JVM is important for two reasons. First, it gives Java developers access to a programming language that is higher-level," Bini says. Second, "Ruby [has] lots of interesting libraries such as Rails and RSpec that can be used on top of the JVM. Being on the JVM also means that when using Ruby you still have access to all the existing Java libraries. JRuby can use any Java class as if it was a Ruby class. This means you get the combined power of both the Ruby language and ecosystem and the Java environment," he says.


Meanwhile, Jython goes all the way back to July 1998 when it was called JPython, Wierzbicki notes. "There is a vast amount of Java out there, and Jython provides a way to access that code from the highly productive Python language," he says. For example, Jython has been used by testing frameworks as an embedded scripting tool.

"I've spoken at many Python conferences like PyCon, EuroPycon, and EuroDjangoCon and I have found that many in the Python community really want to be able to use Python on the JVM," he adds.


Also atop the JVM is Clojure (pronounced "closure"), developed to support functional style and better concurrent programming on the JVM, says Hickey. It is leveraged for multithreaded application development. "The intent of Clojure is to be useful wherever Java is useful," Hickey notes -- thus its use of Java libraries and a syntax to support Java calls transparently.


Debuting in 2004 and boasting Twitter and LinkedIn as users, Scala arose out of Odersky's desire to improve on Java. While the Java platform has offered capabilities such as type safety and garbage collection for object disposal, more was needed, he says. "We wanted to make Java more expressive, so people could be more productive" and write at a higher level of abstraction with fewer lines of code, Odersky says. Scala differs from other JVM-compatible languages such as JRuby, Jython, and Clojure in that it deploys a refined static type system and offers more expressive programming, he says.


Another language for the JVM is Groovy, which has a mixed reputation among developers. Billed as "an agile dynamic language for the JVM," Groovy builds on Java strengths while also offering features inspired by languages such as Ruby and SmallTalk, says the Groovy Web page on Codehaus.

"It's definitely easier to program," with Groovy than Java, says Jon Travis, principal software engineer at SpringSource, which oversees development of the Groovy language. "Groovy all around adds a lot of expressiveness for people who are very familiar with Java," he notes.

PHP so far not catching on among JVM developers

While Ruby and Python implementations have gained a foothold on the JVM, the same oddly is not true for the popular PHP language, says Sun's Bray. "The No. 1 candidate that people are working [on] but isn't really there yet in terms of widespread adoption is PHP," he notes.

Join the Good Gear Guide newsletter!

Error: Please check your email address.

Tags software developmentjrubyphpjavajvmclojurescalagroovyjython

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Paul Krill

Show Comments


Microsoft L5V-00027 Sculpt Ergonomic Keyboard Desktop

Learn more >

Lexar® JumpDrive® S57 USB 3.0 flash drive

Learn more >


Lexar® JumpDrive® S45 USB 3.0 flash drive 

Learn more >


HD Pan/Tilt Wi-Fi Camera with Night Vision NC450

Learn more >

Lexar® Professional 1800x microSDHC™/microSDXC™ UHS-II cards 

Learn more >

Audio-Technica ATH-ANC70 Noise Cancelling Headphones

Learn more >

Lexar® JumpDrive® C20c USB Type-C flash drive 

Learn more >


Back To Business Guide

Click for more ›

Most Popular Reviews

Latest News Articles


PCW Evaluation Team

Azadeh Williams

HP OfficeJet Pro 8730

A smarter way to print for busy small business owners, combining speedy printing with scanning and copying, making it easier to produce high quality documents and images at a touch of a button.

Andrew Grant

HP OfficeJet Pro 8730

I've had a multifunction printer in the office going on 10 years now. It was a neat bit of kit back in the day -- print, copy, scan, fax -- when printing over WiFi felt a bit like magic. It’s seen better days though and an upgrade’s well overdue. This HP OfficeJet Pro 8730 looks like it ticks all the same boxes: print, copy, scan, and fax. (Really? Does anyone fax anything any more? I guess it's good to know the facility’s there, just in case.) Printing over WiFi is more-or- less standard these days.

Ed Dawson

HP OfficeJet Pro 8730

As a freelance writer who is always on the go, I like my technology to be both efficient and effective so I can do my job well. The HP OfficeJet Pro 8730 Inkjet Printer ticks all the boxes in terms of form factor, performance and user interface.

Michael Hargreaves

Windows 10 for Business / Dell XPS 13

I’d happily recommend this touchscreen laptop and Windows 10 as a great way to get serious work done at a desk or on the road.

Aysha Strobbe

Windows 10 / HP Spectre x360

Ultimately, I think the Windows 10 environment is excellent for me as it caters for so many different uses. The inclusion of the Xbox app is also great for when you need some downtime too!

Mark Escubio

Windows 10 / Lenovo Yoga 910

For me, the Xbox Play Anywhere is a great new feature as it allows you to play your current Xbox games with higher resolutions and better graphics without forking out extra cash for another copy. Although available titles are still scarce, but I’m sure it will grow in time.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?