//NOVEMBER/DECEMBER 2014 /

THE IS EVERYWHERE 13 29 20 HENRIK STÅHL INDUSTRIAL AUTOMATION JAVA: THE NEXT ON JAVA AND IOT WITH ROBOTS GENERATION

ORACLE.COM/JAVAMAGAZINE //table of contents /

13 20 29 COMMUNITY JAVA: THE NEXT ROBOTS MAKE JAVA DEVELOPMENT GENERATION FACTORIES Teach kids to code SMARTER and give them tools Keba’s systems help FOR THE INTERNET for success. usher in the next OF THINGS industrial revolution. JAVA IN ACTION Oracle’s Henrik Ståhl discusses the Internet of Things for Java developers.

Internet

of Things JAVA TECH

New theme icon. See how it works.

COVER ART BY LINDY GROENING

COMMUNITY JAVA TECH 45 55

03 35 Embedded Rich Client ABOUT US From the Editor New to Java A Smart-Home Platform Building Castles in the Sky 05 Code Java on the for the Mass Market Use JavaFX 3D to model historical Java Nation BlueJ brings Java SE 8 development SmartHome bridges the gap treasures and more. JavaOne recap, plus news, directly to the Raspberry Pi. between tech-savvy users and average 62 people, events, and books 38 users to provide a smart-home platform Rich Client for everyone. Java Architect A Bridge from Java 2D to JavaFX 25 50 JCP Executive Series jdeps, Compact Profiles, Profit from the easy migration path The Java Advantage for IoT and Java Modularity Embedded provided by FXGraphics2D. Freescale’s Maulin Patel discusses the A look at the future of Java modularity The Device I/O API 67 Internet of Things (IoT) and how the JCP 41 A standard API for peripherals and Fix This helps to facilitate evolving technologies. low-level hardware control just arrived Take our JAX-RS code challenge! Java Architect for Oracle Java SE Embedded. JDK 8u20 Improves Performance, blog JAVA IN ACTION Security, and Manageability 34 Learn how to better control managed IoT Developer Challenge Winner systems that run multiple rich internet Lhings Connected Table applications. 01

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014 EDITORIAL PUBLISHING Editor in Chief Publisher Caroline Kvitka Jennifer Hamilton +1.650.506.3794 COMMUNITY Community Editor Associate Publisher and Audience Yolande Poirier Development Director Java in Action Editor Karin Kinnear +1.650.506.1985 Michelle Kovac ADVERTISING SALES Technology Editor President, Sprocket Media Tori Wieldt Kyle Walkenhorst +1.323.340.8585 Contributing Writer Western and Central US, LAD, and Kevin Farnham Canada, Sprocket Media 3 Billion Contributing Editors Tom Cometa +1.510.339.2403 Claire Breen, Blair Campbell, Eastern US and EMEA/APAC, Kay Keppler, Karen Perkins Sprocket Media IN ACTION JAVA DESIGN Mark Makinney +1.805.709.4745 Devices Run Java Senior Creative Director Advertising Sales Assistant Francisco G Delgadillo Cindy Elhaj +1.626.396.9400 x 201 Senior Design Director Mailing-List Rentals Suemi Lam Contact your sales representative. Design Director RESOURCES Richard Merchán Oracle Products

Contributing Designers +1.800.367.8674 (US/Canada) TECH JAVA Jaime Ferrand, Diane Murray, Oracle Services ATMs, Smartcards, POS Terminals, Blu-ray Players, Arianna Pucherelli +1.888.283.0591 (US) Production Designers Sheila Brennan, Kathy Cygnarowicz Oracle Press Books Set Top Boxes, Multifunction Printers, PCs, Servers, oraclepressbooks.com Routers, Switches, Parking Meters, Smart Meters, Lottery Systems, Airplane Systems, IoT Gateways, ARTICLE SUBMISSION ABOUT US If you are interested in submitting an article, please e-mail the editors. Programmable Logic Controllers, Optical Sensors, SUBSCRIPTION INFORMATION Subscriptions are complimentary for qualified individuals who complete the Wireless M2M Modules, Access Control Systems, subscription form. MAGAZINE CUSTOMER SERVICE Medical Devices, Building Controls, Automobiles… [email protected] Phone +1.847.763.9635 PRIVACY Oracle Publishing allows sharing of its mailing list with selected third parties. If you prefer that your mailing address or e-mail address not be included in this program, contact Customer Service.

Copyright © 2014, Oracle and/or its affiliates. All Rights Reserved. No part of this publication may be reprinted or otherwise reproduced without permission from the editors. JAVA MAGAZINE IS PROVIDED ON AN “AS IS” BASIS. ORACLE EXPRESSLY DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ORACLE BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING FROM YOUR USE OF OR RELIANCE ON ANY INFORMATION PROVIDED HEREIN. The #1 Development Platform information is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied blog upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Oracle and Java are registered trademarks of and/or its affiliates. Other names may be trademarks of their respective owners. Java Magazine is published bimonthly with a free subscription price by Oracle, 500 Oracle Parkway, MS OPL-3C, Redwood City, CA 94065-1600. Digital Publishing by GTxcel 02

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014 //from the editor / COMMUNITY JAVA IN ACTION

ava is everywhere. As the Internet of Things (IoT) moves from hype to reality, we’re seeing embedded Java used in a wide range of applications, from industrial automation systems and medical imaging devices to Jconnected vehicles and smart meters. Haven’t you heard? Java is the glue. Internet JAVA TECH In our interview with Oracle’s Henrik Ståhl, we discuss the opportunities and challenges of Things that the IoT presents for Java developers, and how changes in Java SE and Java ME (and their embedded versions) make it easier to reassemble and strip down code for smaller devices. We have lots of additional IoT content in this issue as well: we talk toFreescale’s Maulin Patel about the IoT and Java, profileIoT Developer Challenge winner Lhings Connected Table, and show you how robots make fac- tories smarter. Plus, Vinicius Senger introduces the Device I/O API, Kai Kreuzer brings us the latest on smart ABOUT US homes, and Michael Kölling shows us how to program in Java on the Raspberry Pi. We also take a look at the developers of tomorrow in “Java: the Next Generation.” I’ve been talking to kids at various programming events for the last few months, and I am inspired. These kids are brave, bold, and so smart. They do not fear technology; they embrace it. I’m thrilled to see so many pro- grams around the world that are teaching young people to code and helping them to //send us your feedback / create their futures. We’ll review all suggestions for future improvements. BIO Caroline Kvitka, Editor in Chief Depending on volume, some messages might not get a direct reply. blog

PHOTOGRAPH BY BOB ADLER 03

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014

// java nation / JavaOne 2014 / COMMUNITY JAVAONE TAKES SAN FRANCISCO

The 19th JavaOne celebrated IN ACTION JAVA momentum in the Java platform, innovation, and strong community. Devoxx4Kids kicked things off a day early, when 150 kids got hands-on and had fun with programming,

robotics, and engineering. The open- TECH JAVA ing Strategy keynote established Oracle’s commitment to building a strong and flexible Java platform that will enable IT professionals to adapt to rapid technological change, from the Internet of Things (IoT) to more-

powerful enterprise systems. ABOUT US Oracle’s Peter Utzschneider said Java has shown strong growth this year, with 80 new Java user groups (JUGs) established and a transpar- ent and accessible (JCP). Java SE 8, released in March 2014, has changed the land- scape for Java developers, thanks to lambda expressions and their ability to reduce the need for boilerplate code, said Oracle’s Georges Saab. blog Utzschneider stressed that the A bird’s-eye view ongoing integration of embedded of Duke’s Café Java with the rest of the platform is enabling developers who have basic

PHOTOGRAPH BY HARTMANN STUDIOS 05

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014 //java nation / JavaOne 2014 / COMMUNITY

From left to

right: Mark IN ACTION JAVA Watch the Strategy keynote. Reinhold, John Rose, James Java skills to use those skills in Gosling, and the embedded space and the grow- Brian Goetz ing IoT. Later, Oracle’s Cameron Purdy emphasized how the Java plat- TECH JAVA form is continuously evolving TECHNICAL KEYNOTE toward end-to-end capabilities. The Technical keynote was held in two parts: one include value classes. Look to Project Valhalla and He acknowledged the help of the that followed the Strategy keynote and a second Project Panama for more information, he said. community and emphasized that that preceded the Community keynote. Oracle’s In part two, Reinhold gathered a panel of Java Java EE 7, the only standards-based Mark Reinhold reflected on Java as it nears its luminaries, including , onstage to platform for enterprise develop- 20th birthday about ways it can keep going for take questions. When asked when Java would ABOUT US ment, is continuing to drive down another 20 years. He addressed the challenges of become obsolete, Gosling confessed that for a the costs of building and maintain- enhancing Java’s ability to scale down, improve decade he has been expecting Java’s demise, but ing applications. He pointed out security, evolve more easily, improve startup that Java is a kind of organism grounded in the that the JCP Executive Committee performance, and scale up to large systems. To community that is well understood and flexible has unanimously approved the address these issues, Java 9 is focused on Project and has strong staying power. roadmap to Java EE 8—which was Jigsaw, which is “an attempt to design and imple- drawn up directly from the survey Watch the ment a standard module system for the Java SE responses of 4,500 Java developers. Technical platform and use that to modularize the platform keynote. Purdy observed that for Java EE 7, 19 itself—and applications,” he said. Jigsaw will have JUGs made valuable contributions a profound impact on how large Java systems are by adopting 14 JSRs, and he called built and maintained and improve developer per- for that kind of community partici- blog formance and productivity, Reinhold said. pation going forward. Next, Brian Goetz offered a vision of Java extending to Java 9 and beyond that would

PHOTOGRAPHS BY HARTMANN STUDIOS 06

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014 //java nation / JavaOne 2014 /

Bruno Paul Perrone

Maisonnier COMMUNITY JAVA IN ACTION JAVA NullPointers

Rock JavaOne TECH JAVA COMMUNITY KEYNOTE

At the JavaOne Community keynote, Java ABOUT US Evangelist James Weaver gathered a large group of innovators, who showed off Java-based projects—everything from programs that teach Andra Kay kids to code to automated vehicle testing sys- The NullPointers, the unofficial Java community band, rocked JavaOne at the tems that can save lives. JCP party and later in the week at Duke’s Robotics was a key theme. Some highlights: in the United States, and showed a video about Café. The band is made up entirely of Andra Kay, director at Silicon Valley Robotics, his automated vehicle testing system with an JavaOne community members. said, “By 2020 your household robot will be advanced braking system that could save lives— your house.” a first step toward cars with full autonomy. Bruno Maisonnier, CEO at Aldebaran, a world The Community keynote ended with the tra- leader in humanoid robots, presented a video ditional T-shirt toss (or catapult), led byJames showing robots teaching children mathematics Gosling. It was the perfect ending to a great blog in schools. week of information sharing, learning, and Paul Perrone of Perrone Robotics lamented the community building. 30,000 deaths from auto accidents each year Watch the Community keynote.

PHOTOGRAPHS BY HARTMANN STUDIOS 07

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014 //java nation / JavaOne 2014 /

JCP Awards COMMUNITY The Java Community Process (JCP) presented GEEKS the 10th annual JCP Awards and celebrated its

RIDE ON 15th birthday at a gather- IN ACTION JAVA The Geek Bike Ride tradi- ing atop the Hilton Hotel tion continued at JavaOne on Monday night. with 35 riders from nine Heather VanCura received the award for JCP countries. Riders sported Program Member of the jerseys designed by com- Year for her leadership in TECH JAVA munity members in Brazil the Adopt-a-JSR program, and enjoyed a sunny day of which provides a mecha- heart-pumping activity. nism for Java user groups (JUGs) and individuals to easily contribute to JSRs and encourages grassroots participation in crafting ABOUT US Otávio Gonçalves de Santana (top), Heather VanCura (top the future of Java. and bottom), and Michael The Most Significant JSR Lagally (bottom) was awarded to JSR 360, Connected Limited Device Configuration (CLDC) 8, which brings language features, including generics, enumerations, and try-with-resources, from Java SE into Java ME. Michael Lagally was recognized as Outstanding Spec Lead for his efforts in spearheading JSR 360. Otávio Gonçalves de Santana was awarded Outstanding Adopt-a-JSR Participant for his work on blog JSR 354, Java Money and Concurrency—specifically in migrating the codebase from Java 7 to Java 8.

BIKE RIDE PHOTOGRAPH BY KEVIN NILSON; JCP PHOTOGRAPHS BY BOB LARSEN 08

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014 //java nation / COMMUNITY

Subramaniam.” Each UJUG meet- ing has two pre- sentations, and the presenter schedule is already filled into IN ACTION JAVA late 2015. Meetings typi- cally start with the traditional pizza, and they often end with a trip to TECH JAVA the local pub for those interested. FEATURED JAVA USER GROUP “Yes, there’s good beer in Utah!” Porter exclaims. He adds that each UJUG meeting is unique. “Something new is tried each month to improve networking and for just plain

UTAH JAVA USERS GROUP ABOUT US fun—we had a paper airplane competition The Utah Java Users Group (UJUG) was mation technology and software development last month.” founded in 1998 by Ben Galbraith and Glen firms along the Wasatch Front in north central If you’re a Java developer who loves skiing or Lewis. The group is currently led by Jason Utah that is “leading the world in innovative the great outdoors, you may want to consider Porter and supported by board members Don memory process technology. . .and data analy- the Silicon Slopes next time you’re seeking Bogardus, Mike Bylund, and Chris Hansen. sis,” according to CNBC. new work. “There’s a healthy startup com- UJUG currently has about 1,000 members. Porter notes that, indeed, the Silicon Slopes munity and a trend for big out-of-state shops Meetings, which are normally held on the phenomenon has had an enormously positive to open local development centers,” says third Thursday of each month, typically draw effect on UJUG’s growth and vivacity. “Silicon Porter. “Developer unemployment in Utah is from 80 to 180 attendees. Slopes has seen a tech boom, and Java is the down to 1.5 percent, with salaries continuing If this level of participation surprises you language of choice in all the major shops, to rise (the latest trend is highway recruiting (because Utah is in the bottom 20 percent of and most of the smaller ones,” he says. “This billboards). All the energy in the ecosystem blog the United States in population density), that makes for great local presenters, and we makes for great UJUG meetings, and a tan- probably means you haven’t heard of “Silicon also get visits from out-of-towners, includ- gible excitement in the community.” Slopes” (@SiliconSlopes), the cluster of infor- ing Jason Van Zyl, Gavin King, and Venkat Learn more at UJUG’s Meetup site.

SKIING PHOTOGRAPH BY MIKE SCHIRF/GETTY IMAGES 09

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014 //java nation /

JAVA CHAMPION PROFILE

BRUNO GHISI COMMUNITY

Java SE puter and program- Ghisi: I love program- my career and take ming language? ming and still do it it to the next level. Updates Ghisi: My first com- as a hobby. I used Great opportunities puter was a 486 PC. to surf, but now I also came from blog- Oracle has released Java I put on it, and enjoy jogging and ging and doing open

SE Development Kit 8 started program- cooking more. source development. IN ACTION JAVA Update 25 (JDK 8u25) ming simple scripts. Java Magazine: What Java Magazine: What and Java SE 7u71 and My first real pro- happens on your are you looking for- Java SE 7u72. gramming language typical day off work? ward to in the com- JDK 8u25 includes was Java. Ghisi: I definitely stay ing years? important security Java Magazine: What with my friends and Ghisi: For the

fixes. Read ther elease was your first profes- family, sometimes past three years, TECH JAVA notes and download sional programming going to the beach. I I have been CTO the update. job? love barbecues, and I [and cofounder] of Bruno Ghisi is Ghisi: Florianópolis, Java SE 7u71 and Java I worked for a also like to travel. Resultados Digitais. an open source a southern Brazil Ghisi: SE 7u72 include impor- mobile company that What We have a product developer, tech- island. Java Magazine: tant security fixes. Read was writing some side effects of your called RD Station, nology blogger, Java Magazine: When the release notes and nice Java ME appli- career do you enjoy which is an online

and cofounder of and how did you first ABOUT US download the update. cations in a period the most? marketing platform, Resultados Digitais, become interested Java SE 7u71 is a Critical when there were no I meet a lot and more than 1,200 an online marketing in computers and Ghisi: Patch Update (CPU), smartphones or app of people that I’ve clients. I love what company. He became programming? which contains fixes to stores. The UIs were long admired. I do. I work with a a Java Champion in Ghisi: My father was security vulnerabilities simple, and net- fantastic team, and September 2007, involved in the first Java Magazine: and critical bugs. Java working was terrible. Has being a Java we have awesome while he was com- computer science SE 7u72 is a Patch Set We ported some of Champion changed customers. For the pleting his under- class at the Federal Update (PSU), which con- the first social net- anything for you coming years, I hope graduate degree at University of Santa tains all of the security works such as Orkut with respect to your to keep learning, the Federal University Catarina, and intro- fixes in the CPUs released (before Facebook) daily life? experience new chal- of Santa Catarina, duced me to main- up to that version, as well and Fotolog to Definitely. I lenges, and probably Brazil. frames at his job Ghisi: as additional noncritical mobile devices. was pretty young have a baby as well. Java Magazine: when I was a child. blog fixes. Learn more about Where did you What Java Magazine: What when I became a Java You can find Bruno CPU and PSU releases. Java Magazine: grow up? was your first com- do you enjoy for fun Champion, and being Ghisi on Twitter as and relaxation? one helped to guide @brunogh. 10

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014 //java nation / COMMUNITY JAVA IN ACTION JAVA JAVA TECH JAVA ABOUT US

Codemotion share everything about the Groovy and EVENTS NOVEMBER 21–22 Grails ecosystems. MADRID, SPAIN Jfokus FEBRUARY 2–4 This conference is open to users of all Riga Dev Day STOCKHOLM, SWEDEN languages and platforms. It offers full-day JANUARY 22, 2015 Jfokus has run for eight years and is the largest annual workshops, keynotes, conference ses- RIGA, LATVIA Java developer conference in Sweden. Conference topics sions, and hackathons across eight tracks. This event is a joint project by Google include Java SE and Java EE, front end and web, mobile, Developer Group Riga, Java User Group continuous delivery and DevOps, Internet of Things, cloud Groovy & Grails eXchange Latvia, and Oracle User Group Latvia. By and big data, future and trends, alternative Java Virtual DECEMBER 11–12 and for software developers, it focuses on blog Machine (JVM) languages, and agile development. LONDON, ENGLAND 25 of the most-relevant topics and tech- This two-day conference brings together nologies for that audience. Tracks include industry-leading experts and develop- JVM and web development, databases, ers from around the world to learn and DevOps, and case studies. PHOTOGRAPH BY EDWARD STOJAKOVIC/FLICKR 11

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014 //java nation /

JAVA BOOKS COMMUNITY JAVA IN ACTION JAVA

SOA WITH JAVA MASTERING LAMBDAS: RESTFUL JAVA WEB SERVICES PROFESSIONAL JAVA EE JAVA EE APPLICATIONS ON By Thomas Erl, Andre Tost, JAVA PROGRAMMING IN A SECURITY DESIGN PATTERNS ORACLE JAVA CLOUD Satadru Roy, Philip Thomas, Raj MULTICORE WORLD By René Enríquez and By Murat Yener and By Harshad Oak Balasubramanian, David Chou, By Maurice Naftalin Andrés Salazar C. Alex Theedom Oracle Press, September 2014 and Thomas Plunkett Oracle Press, November 2014 Packt Publishing, July 2014 Wiley, December 2014 Learn how to build highly JAVA TECH JAVA Prentice Hall, June 2014 This Oracle Press book pro- This book will serve as a Professional Java EE Design available, scalable, secure, Java has evolved into an vides a complete ground- practical companion for Patterns is the perfect distributed applications exceptional platform for ing in the theory of lambda you to learn about com- companion for anyone who on Oracle Java Cloud with building web-based enter- expressions and the ratio- mon vulnerabilities when wants to work more effec- Java Champion Harshad prise services. In SOA with nale for their introduc- using RESTful services. You tively with Java EE. It’s the Oak. He leads you through Java, Thomas Erl and sev- tion and use in practice. It will gain indispensable only resource that covers the entire Java EE cloud- eral world-class experts reviews a simple Java code knowledge of the tools you both the theory and appli- based application life- ABOUT US guide readers in mastering fragment iterated over a can use to implement and cation of design patterns cycle, from development the principles, best prac- collection, poses differ- test security on your appli- in solving real-world prob- to deployment. Filled tices, and Java technolo- ent challenges, and then cations.RESTful Java Web lems. The authors guide with real-world examples, gies required to design and delves into the fundamen- Services Security covers readers through the funda- ready-to-use code, and deliver high-value services tals of syntax and basic the finer details of setting mental and advanced fea- best practices,Java EE and service-oriented solu- use. Maurice Naftalin rec- up RESTful services—for tures of Java EE 7, present- Applications on Oracle tions. The book is appro- ommends best practices example, implementing ing patterns throughout Java Cloud is an invaluable priate for any technical for adding lambda expres- RESTEasy, securing trans- and demonstrating how resource for anyone look- professional whose aim is sions to an existing library mission protocols such they are used in day-to- ing to meet the growing to design and implement and explores the changing as OAuth, and integrating day problem solving. demand for cloud-based web-based service- Collections Framework. OAuth with RESTEasy. development skills. oriented architectures and blog enterprise solutions with Java technologies.

12

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014 COMMUNITY

Oracle’s Henrik Ståhl JAVA DEVELOPMENT discusses the Internet of Things for Java developers. FOR THE INTERNET OF THINGS BY TIMOTHY BENEKE JAVA IN ACTION

Internet of Things

he Internet of Things (IoT) is JAVA TECH poised to blow into our daily lives and make many of the things we interact with Tmore efficient, faster, and more fun. Analysts predict that by 2020 there

will be 50 billion devices wirelessly ABOUT US connected to each other and making smart decisions for us. We’re seeing early adoption in healthcare, includ- ing lifestyle health devices, patient monitoring, and home healthcare. Another big area is telematics in the automotive industry—not to men- tion home automation. Suffice it to say that everything from our homes to healthcare to the workplace will change due to the IoT. For Java developers, many oppor- blog tunities and questions present them- selves. How can they deploy their present skills to better apply them to IoT development? What changes PHOTOGRAPHY BY NAME HERE 13

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014 COMMUNITY

in the Java platform should future IoT developers know about? What are the security issues? We met up with Henrik Ståhl, vice president of product management for Java and the IoT at Oracle, to discuss JAVA IN ACTION these and other issues.

Java Magazine: What is Oracle doing to help Java developers enter the IoT space? Ståhl: Java developers can already use their skills to develop back-end appli- JAVA TECH cations for the IoT. We want them to also be able to develop software on the various devices that constitute the devices—the things in the IoT—using the same language, the same APIs, and compact runtimes suitable for the ABOUT US embedded space, which in the past has involved a steep learning curve for everyone who ventures into it. Instead, developers have had to learn low-level does not currently exist in the embed- to make them as compatible with each Henrik Ståhl at work languages that impede productivity ded space. other—and with the mainstream Oracle at Oracle’s Stockholm, and lead to relatively high maintenance To achieve this vision, it is vital that JDK 8—as possible. Sweden, office costs. Now, because embedded devel- we get to a common programming To get toward this goal while achiev- opment often includes integration with model across all devices, regardless ing low memory and disk footprints, various types of specialized peripherals of size or device capabilities. With the we have introduced the concept of and sensors, it will likely always require release of Oracle Java ME Embedded 8 Compact Profiles in Java SE 8. These some amount of low-level program- and Oracle Java SE Embedded 8, we give developers a choice of deploying ming. We are not aiming to replace have made the features that developers the entire set of Java SE APIs, or one of blog that, but rather to enable an application are used to in Java available on embed- three different subsets that are incre- developer to work in Java, freeing up the ded platforms with as little as a couple mentally smaller. These subsets have system developer to focus only on the of hundred kilobytes of memory. A been selected very carefully to match hardware enablement. This distinction major goal of these two releases was what APIs are needed for common use 14

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014 COMMUNITY JAVA IN ACTION Watch the video: Java Embedded for IoT

ded gateways. This brings the Java ME Raspberry Pi. Our traction in the micro- APIs much closer, but not quite on par, controller space is more limited to JAVA TECH with Java SE. We plan to continue this date, but with the release of Oracle Java development and are looking at things ME Embedded 8 we believe that our missing from Java ME such as lambdas, platform is well suited to meet market reflection, and better integration with demands. And so, we think that with native code. enough energy and support coming These embedded Java platforms are from the Java community and Oracle, ABOUT US the number one thing that we are pro- we can get Java developers to start Ståhl (center) shows a cases such as running an OSGi [Open viding to embedded developers. focusing on embedded. This brings an demo to colleagues Klara Service Gateway initiative] stack. The And as we include tools—for example, immediate benefit to the IoT because Ward and Erik Helin. Compact Profiles are a stepping-stone on the Java ME side so that it catches up Java greatly facilitates key device-side toward more-granular modularity that with the likes of Java SE—it will be really requirements such as communica- will be introduced with Project Jigsaw in easy for the 9 million Java developers tions, integration, security, and a flex- Java SE 9. to start taking on embedded projects, ible application model. The notion of As for Oracle Java ME Embedded 8, which is something that we are obvi- having billions of things out there on we have come a very long way from its ously trying to encourage. We have seen constrained form factors means that roots as a platform for feature phones. very good uptake of Java already in the we need programming models to push The APIs and the application deploy- higher-end devices, such as wireless business logic to the network edge and ment model have been massively modules (small chips that integrate a make decisions at the perimeter of the blog updated to fit their target to run on low-power CPU, some memory, and a network as opposed to centralizing all small embedded devices, including 3/4G modem for communications) and communication behind the customer medium- to high-end microcontrollers, larger SoCs [systems on a chip] includ- firewall and the cloud. So, the embed- smart sensors, and small embed- ing the popular hobbyist-targeted ded Java platform is only going to 15

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014 DEVELOPING ON DEVICES

“Java developers can already use their skills to develop COMMUNITY back-end applications for the IoT. We want them to also be able to develop software on the various devices that constitute the devices in the IoT.” , JAVA IN ACTION

become more important moving for- have a retail application, you ward, as Java developers start to key in can now extend that retail on the IoT. application to iBeacon and do Java Magazine: What’s happening with proximity marketing. If you Java ME? have an application that does JAVA TECH Ståhl: We released Java ME 8 and we input payment or serves up are planning another release in 2015, ads for automobile custom- where you will see a lot of incremen- ers, you can now extend that tal enhancements that build on the all the way to the automobile capabilities of the Java ME 8 platform. and actually start getting back You’re going to see additional platform information from its various ABOUT US support, improved runtime perfor- systems that will allow you to mance—all of the things that we’re offer a pretty good mainte- focusing on or that we have focused on nance plan. tion. It’s necessary but insufficient to Ståhl talks with colleague in Java SE 8. You are also going to see And if you want to better orches- derive value from the use cases. It’s Stefan Särne. uptake in the field by hardware manu- trate the subsystems in a building, really the rest of the application that facturers that integrate Java ME directly you can now do that by tying in to the becomes more valuable. For example, a in their devices, greatly increasing the HVAC system and the lighting system, retail application—from Oracle or from adoption rate. and doing that across vendors with a somewhere else—becomes much more Java Magazine: What do you want Java standard platform such as Java. The valuable when you can use it to do developers to understand as they apply ability to connect to edge devices—for proximity-based marketing or provide their skills in an embedded context? example, an actuator, a valve, or what- proximity-based offers depending on Ståhl: With our embedded platforms, ever, depending on the use case—and where somebody is in a store. blog Oracle is enabling all of the applica- control these systems is one of the key So embedded Java becomes the tions in the Oracle portfolio and all of enablers of the IoT. enabling technology. For developers the applications being built by the Java I am quick to caution that it’s not who pay attention, this will allow them community to talk to the IoT. So if you necessarily the biggest value proposi- to tap into an entirely new class of appli- 16

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014 COMMUNITY

cations that extend existing solutions. the same device. This has been hugely Ståhl: The IoT introduces risk on a Java Magazine: What key features of beneficial to Java for server applica- number of levels. There are three dif- Java make it a good fit for the IoT? tions. But it is even more important ferent approaches that we’re taking, Ståhl: What’s important about Java for embedded because there is such and we’re relying on standards wher- is the abstraction and portability that a massive diversity of hardware archi- ever possible to make sure we provide the runtime environment provides. tectures, operating systems, peripher- a proven solution. JAVA IN ACTION Organizations that need to deploy als, and so on. The simple benefit of First, there is a vulnerability on the Ståhl notes that in devices as part of an IoT solution can being able to reuse application code device itself. So, for example, if you the IoT space, security decouple their applications and librar- is in itself a very strong argument for had a vending machine to hook up to repeatedly comes ies from specific devices, enabling Java. Of course, the rich set of standard the internet and you could use that to up as an underlying reuse of code between different devices APIs and the predictable development access other systems, then harden- limiting concern. and between different generations of cycle and lifetime of the Java platform ing that system at the edge is hugely itself are also strong important. This is further aggravated by JAVA TECH arguments. the fact that the devices are often not Another benefit of the physically secure and—even worse—in runtime environment is some cases, they are under the physi- encapsulation. The fact cal control of the entity most interested that we’re running within in hacking into them. I often use smart the JVM [Java Virtual meters as an example: The person ABOUT US Machine] and restricting in whose house the smart meter is the developer from doing installed is the person who benefits things that are not per- most from hacking it. formed via some well- Second, the middle piece of secu- defined API means that rity is data transmission, where we are we’re providing an addi- relying on internet standards; encrypt- tional layer of security. ing things on the edge and then on the In the IoT space, security back end; and sending the data over repeatedly comes up the encrypted channel. With traditional as the underlying limit- internet security, we have a concern ing concern that people that there’s a man in the middle who’s have about jumping into going to intercept something and replay blog this industry. it as an attack. With the IoT, the concern Java Magazine: Tell us is more that you think you’re talking to a more about security and smart toaster in your house when really the IoT. you’re talking to a hacker in his mom’s 17

ORACLE.COM/JAVAMAGAZINE //////////////////////////////// NOVEMBER/DECEMBER 2014 COMMUNITY

has not been modified or standpoint, and that is not going to tampered with on the way, change. Oracle’s belief is that by con- and that only authorized tinuing to invest in these areas, Java individuals have access will remain vibrant, the community to it? will remain engaged with Oracle, and Of course, all of these Oracle and the community will con- JAVA IN ACTION areas have to be managed tinue to have a creative and beneficial such that an administra- ongoing relationship. I would like to tor—or, in the case of per- finally put to rest the FUD [fear, uncer- sonal data, an individual— tainty, and doubt] about Java being can control the security a legacy language and platform. The configuration, the authen- reality is that Java is rejuvenating itself tication, and the authori- across the board with new innovation JAVA TECH zation through policies. and new growth in community activity. Java Magazine: Any This includes the addition of new Java final thoughts for Java user groups, and an unprecedented developers? rate of adoption of Java 8 including in Ståhl: Oracle is redoubling hot areas such as the cloud and, yes, its efforts to keep Java the IoT. Developers have the tools and ABOUT US vibrant and is continuing a commitment from Oracle and the to honor its commitment community to do everything possible Ståhl says that Oracle basement. That’s the big concern. to add new productivity features— to make them successful.