Welcome!

Java IoT Authors: Elizabeth White, Liz McMillan, Yeshim Deniz, Zakia Bouachraoui, Pat Romanski

Related Topics: Java IoT

Java IoT: Article

Code Warrior

Code Warrior

Since the introduction of Java and Sun's Java Development Kit over nine months ago, Mac users have been left out in the cold waiting for their turn to get the slick GUI development environments. Sun finally came out with the JDK for the Mac, and now Metrowerks, whose CodeWarrior development environment has dominated the Macintosh programming tool market, has extended its reach to include Java with the recent release of CodeWarrior Gold 9. In this issue the Java Developer's Journal will take a look at CodeWarrior Gold 9 and let you know how it stacks up.

First Impressions
CodeWarrior Gold is Metrowerks' professional bundle, providing an extensive development environment with several languages (C, C++, Object Pascal, Java) and target platforms (Mac, Windows, BeBox, MagicCap). With the Gold package, you get a QuickStart manual, and 2 CD-ROM's: one containing the tool set and the other containing documentation and examples. Documentation is generally provided in both eDOC and Acrobat formats, with readers provided. A full installation of the CodeWarrior Gold tool set would require almost 240Mbytes of disk space! With a development environment this complex, it would be easy for a first-time user to get lost; Metrowerks provides a Java-specific document on the second CD that explains how to use the various tools from a Java perspective. This document is a good starting point for someone new to CodeWarrior. Ignoring the many other aspects of CodeWarrior Gold, this review covers only Java development.

The documentation identified the Java support as Beta. However, the parts of CodeWarrior that are not Java-specific (such as project management and editing) are solid. CodeWarrior 9 appears to be based on JavaSoft's JDK 1.0.1 (as indicated by the appletviewer properties).

Getting Started
The Java-only environment created using the installer only occupies about 13MByte of disk space; this figure does not include API documentation or sample code. CodeWarrior Gold 9 provides Java support for PowerPC as well as 68K Macs; in fact, this version of CodeWarrior works fine even on old 68030 machines. CodeWarrior works using the, now common, project-centric approach. When creating a new project, you can select from a variety of predefined stationary that automatically configures many of the per-project preferences. For each file in the project, the project window indicates if the file needs to be compiled, its code size, and if debugging information is generated. You can mix Java and non-Java files in the project to keep track of all files related to a project; CodeWarrior only attempts to compile the files containing Java as indicated by file extension or type. Of course, CodeWarrior keeps track of the status of your source files and only compiles the files that are out-of-date. You can manually trigger a recompile from the project window.

A project can be one of four types: the usual "class folder" where the .class files for the applet are placed in a separate folder; a ".zip" where CodeWarrior automatically builds a single Java-compatible .zip library file of your classes; a "runnable .zip"; or a "droplet." These last two project types give CodeWarrior a unique advantage when developing Java applications. For a "runnable .zip", CodeWarrior embeds the .zip library file into a dummy application that, in turn, invokes the Java virtual machine when launched. A "droplet" extends this concept further to allow you to build a drag-and-drop Java application where the name of the "dropped" file is automatically provided as the first parameter to main().

CodeWarrior Gold does not provide any facilities for source code control. An optional source-code control application is available.

Code Editor
CodeWarrior provides a fairly standard source code editor that can color comments, keywords and strings differently, but does not provide a reformatting function nor tools for inserting templates for class, method or HTML definitions. The editor does provide support for both horizontal and vertical window "panes" and a quick navigation pop-up menu to move to a given function declaration. The editor, if not notable, is solid.

Class Browser
CodeWarrior incorporates several different styles of browsers to help the user navigate through their various source files. You can display a "catalog" of items, such as methods and classes, from the project. The catalog window provides a quick way to view a listing of all classes or functions in the current project; however, the method display window is a bit crowded since it gives the fully quantified declaration for a function, and it didn't identify as "constants" the Java convention of final static declarations. The multi-class browser provides the next level of detail; it shows the class hierarchy, method definitions, local variables, and a lower window pane for editing. A detailed, single-class browser can be invoked from the class display in the catalog. This browser window shows the "bases" of the class, that is the classes it extends or implements; a listing of methods, a listing of instance variables and the source code related to the select method or variable; you can also edit this source code directly in this lower window pane.

Though they provide adequate functionality, these separate browser modes seems somewhat clumsy when compared to the class browsing offered by other environments.

Runtime
Metrowerks merged several of JavaSoft's Java runtime programs into a single application called "Metrowerks Java." This application can function as an applet viewer, an application runner, a Java compiler (the standard JavaSoft reference version), class dumper, and header file generator. Because JavaSoft's standard Java runtime cannot unload a class, you need to quit Metrowerks Java and restart it after recompiling your source code. You can control various parameters of the virtual machine operation, including class search paths, heap and code stack sizes, and garbage collection rules.

The Java runtime provides a console output window for program diagnostic messages, a display of virtual machine status (CPU load and memory usage) and a thread state indicator. The thread state window shows a moving history of the state of all threads in the system and their transitions between states.

Given CodeWarrior's multi-language abilities, it is natural that it should support native Java functions. Alas, native methods are not yet fully supported; more information about what you can do with native methods is available from Metrowerks technical support.

Debugger
Aside from application development support, the other distinguishing feature of CodeWarrior is its source-level debugger. Though there are a few missing features in this beta release, you are able to set and clear breakpoints by clicking next to a source line of text, view the call chain, step through code, and inspect variables. You can also set breakpoints to catch the various Java exceptions without actually adding code to your application. You can even invoke the debugger against an already running applications or applet. I had several crashes on a 68K Mac when trying to view byte-codes; but since source display worked fine and is the obvious preference, the debugger is quite usable even on old machines.

Conclusions
While Metrowerks is a relatively late-comer to the Java market, its leadership in the C/C++ development market is providing a solid base from which to become the dominant supplier of Java tools also. The stability of this Beta release stems in large part from Metrowerks' ability to extend their proven development environment, though there are places where the use of non-Java terminology may be initially confusing. CodeWarrior Gold 9 offers solid Java performance and some interesting new twists for building applications.

More Stories By Jim Mathis

Jim Mathis is a freelance Java and JavaScript consultant and a communications systems architect. Jim is a contributing writer to Java Developer's Journal and has been active in the Internet community from its very beginnings and wrote one of the first implementations of TCP/IP.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


IoT & Smart Cities Stories
IoT is rapidly becoming mainstream as more and more investments are made into the platforms and technology. As this movement continues to expand and gain momentum it creates a massive wall of noise that can be difficult to sift through. Unfortunately, this inevitably makes IoT less approachable for people to get started with and can hamper efforts to integrate this key technology into your own portfolio. There are so many connected products already in place today with many hundreds more on the h...
SYS-CON Events announced today that IoT Global Network has been named “Media Sponsor” of SYS-CON's @ThingsExpo, which will take place on June 6–8, 2017, at the Javits Center in New York City, NY. The IoT Global Network is a platform where you can connect with industry experts and network across the IoT community to build the successful IoT business of the future.
CloudEXPO New York 2018, colocated with DXWorldEXPO New York 2018 will be held November 11-13, 2018, in New York City and will bring together Cloud Computing, FinTech and Blockchain, Digital Transformation, Big Data, Internet of Things, DevOps, AI, Machine Learning and WebRTC to one location.
Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereal. Andrew's role at ConsenSys Enterprise is a mul...
DXWorldEXPO | CloudEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
Disruption, Innovation, Artificial Intelligence and Machine Learning, Leadership and Management hear these words all day every day... lofty goals but how do we make it real? Add to that, that simply put, people don't like change. But what if we could implement and utilize these enterprise tools in a fast and "Non-Disruptive" way, enabling us to glean insights about our business, identify and reduce exposure, risk and liability, and secure business continuity?
The best way to leverage your Cloud Expo presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering Cloud Expo and @ThingsExpo will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at Cloud Expo. Product announcements during our show provide your company with the most reach through our targeted audiences.
DXWorldEXPO LLC announced today that Telecom Reseller has been named "Media Sponsor" of CloudEXPO | DXWorldEXPO 2018 New York, which will take place on November 11-13, 2018 in New York City, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
To Really Work for Enterprises, MultiCloud Adoption Requires Far Better and Inclusive Cloud Monitoring and Cost Management … But How? Overwhelmingly, even as enterprises have adopted cloud computing and are expanding to multi-cloud computing, IT leaders remain concerned about how to monitor, manage and control costs across hybrid and multi-cloud deployments. It’s clear that traditional IT monitoring and management approaches, designed after all for on-premises data centers, are falling short in ...
The deluge of IoT sensor data collected from connected devices and the powerful AI required to make that data actionable are giving rise to a hybrid ecosystem in which cloud, on-prem and edge processes become interweaved. Attendees will learn how emerging composable infrastructure solutions deliver the adaptive architecture needed to manage this new data reality. Machine learning algorithms can better anticipate data storms and automate resources to support surges, including fully scalable GPU-c...