With mature technologies like JSP, servlets, and Enterprise Java Beans (EJB) in place for some time now, Java has an undeniable server-side presence. In fact, many developers are increasingly viewing Java as a server-side-only language. Lately, however, Java brewers have been making headway into a surprising area: embedded systems development. Let’s take a look at the advantages Java brings to the game, and some of the obstacles it must overcome to achieve more widespread use. First, though, let’s consider what embedded systems development actually means.

What constitutes an embedded system?
According to Tom Williams, embedded systems analyst for Evans Data Corporation, the term embedded system is broadly used to refer to anything controlled by a microprocessor. That would include your trusty PDA, many kinds of factory equipment, your set-top cable or satellite TV box, your favorite video-game console, and probably even that dirty microwave oven sitting in your kitchen. Embedded development then, by extension, would refer to the creation of any software meant to control the embedded device. Partly because of the wide range of hardware in use, there is no “typical” embedded development project, nor is there really a “killer application.”

Enter Java, stage right
Until recently, creating software to run a microprocessor-controlled device was no mean feat. Doing so usually involved the use of proprietary languages at or below the assembler level, although C could occasionally be used instead. With software tied so tightly to hardware, being cross-platform was a pipe dream:

Porting an application from one processor platform to another usually involved rewriting it completely.

Now, embedded systems development appears to be seriously taking off: Work on embedded systems has intensified over the last 12 months and is expected to grow substantially, particularly as new “smart” electronics devices are released to the public. With so many new projects cropping up, it simply won’t pay to be tied to a single hardware configuration anymore. So Java, with its trademark portability, has become a popular choice for embedded software development.

How popular is it, exactly? Evans Data recently concluded a survey of 444 embedded developers and found that 36 percent of the respondents are either currently using Java or plan to on their next project—up from 26 percent six months ago. Of those developers using Java, nearly 60 percent are using Sun-specific JVM implementations (31.2 percent J2ME and 28 percent J2SE), with an additional 22.6 percent favoring IBM’s Visual Age Micro Edition. Figure A shows the breakdown.

Figure A: Java popularity
Sun and IBM lead the pack.

Not surprisingly, portability was cited as Java’s primary advantage by 43 percent of respondents. Internet connectivity was the second most cited advantage with 21.5 percent. Figure B shows the complete results.

Figure B: Java advantages
Portability is king.

Portability and Internet connectivity alone offer huge advantages over the other options developers have for embedded development, Williams said. “Java represents a possible means of making systems easier to build, use, modify, and communicate with.” He added, “Its major penetration seems to be among devices that need a human interface and which may want to connect and share applications over the Internet.”

Performance problems and potential remedies
Java isn’t a perfect solution, though: All that portability exacts a cost in terms of performance in a desktop application, and things are no different in an embedded environment. Other problem areas, according to Evans Data’s survey results, include a lack of support for “real-time processing,” where a processor executes instructions as they come in instead of scheduling them for execution later when an execution queue fills.

Poor performance is a common complaint about Java, and the language was never really intended to support real-time processing. As a result, many projects are actually Java hybrids, with Java providing higher-level structure and components like UI and Internet connectivity and a lower-level language, like C, providing direct hardware manipulation and performance-critical components. So where does that leave purist and that “100 percent Java” implementation?

A lot of work is currently being done to overcome Java’s disadvantages. The most interesting is the advent of silicon chips meant to directly execute Java byte code, removing the need for a resident JVM and thereby markedly improving performance. While such a novel solution may sound like just the ticket, Williams suggests that these chips aren’t as widely accepted as you might think.

“One issue is price,” he said. “Another is that you still have to write some specialized code in non-Java languages in order to directly manipulate the underlying hardware.” This essentially leaves you with a hybrid solution again. In addition, Williams said, “There are ongoing attempts to make Java more appropriate for real time. Among the companies involved are Intrinsyc, Esmertec, IBM, NewMonics and, of course, Sun.”

However, the “100 percent Java” implementation is still a ways off. Performance can be improved by faster hardware and more efficient JVMs, but the major stumbling block will likely remain real-time processing.

“Java was not originally conceived for real-time applications, and attempts to modify it for real time can deviate from ‘true Java.’ Staying with true Java is absolutely necessary for portable applications.”

As it stands now, Williams said, developers have a decision to make.

“Do they use Java for some of its benefits, but modified in the interest of performance and thus not fully portable, or do they give up some real-time performance in favor of full Java compliance? There is, at this point, no completely unambiguous solution.”

Pure Java

What do you think of Java beyond the server? Post a comment below or contact the editors.