Paul Krill
Editor at Large

DukeScript brings Java to HTML5, JavaScript

news
Sep 30, 20142 mins

Framework lets developers leverage Java while building HTML5 and JavaScript applications

C++ Java PHP .Net Python JavaScript code
Credit: Thinkstock

DukeScript, its name derived from Duke, the Java mascot, gives Java developers a way to build HTML5 and JavaScript applications within the comfort of the Java language.

Released earlier this month, DukeScript 1.0 is a framework for developing cross-platform mobile, desktop, and Web applications. These are Java applications that internally use HTML5 technologies and JavaScript for rendering.

“The technology is client-side technology,” DukeScript inventor Jaroslav Tulach, a NetBeans platform architect at Oracle, said this week at the JavaOne conference in San Francisco, which has a multitude of JavaScript sessions this year.

Developers can write Java code while leveraging the latest developments in modern UI technology. DukeScript can combine with frameworks such as Bootstrap to provide responsive layouts. DukeScript also supports the Knockout JavaScript framework, along with technologies such as the canvas API.

On the desktop, DukeScript leverages the HotSpot VM to run Java code; on Google Android devices, it’s the Dalvik VM is used; and for Apple iOS devices, RoboVM technology enables DukeScript. “The problem on iOS is you cannot do dynamic code generation, but that’s exactly what RoboVM avoids,” Tulach said.

For enterprise applications, DukeScript enforces a separation of concerns, using HTML for the view and Java for business logic while integrating with Java EE (Enterprise Edition) and other back ends.

Any improvements to DukeScript, meanwhile, will be driven by need, said Tulach. But developers of DukeScript would like to see more converted JavaScript libraries. “The whole system is modular, so we don’t put these libraries into the code,” Tulach said. DukeScript can work on Chrome, Safari, and Firefox browsers but is slower on Firefox.

Among the apps built with DukeScript are a Minesweeper game, used to demonstrate DukeScript running on any device with a responsive design, and Leaflet4j, an API for interacting within maps in an application and featuring interaction with the JavaFX rich client technology.

“We don’t want to limit you to the technologies we like or support directly. It’s dead simple to extend DukeScript with your own ideas,” the DukeScript Web page emphasizes.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author