Last Updated: May 20, 2009
Is the Java™ platform ready for real-time? Build your own real-time Java application and see for yourself.
The Real-Time Specification for Java™ (RTSJ) supercharges the Java programming language by bringing:
- Precise scheduling through real-time threads
- High levels of predictability using new memory management schemes
- Safe, asynchronous control in the face of real world events
- Timing precision down to the nanosecond
- The ability to code entire applications — even device drivers — in
the Java language
The Real-Time Specification for Java™ (JSR-01) provides a number of key application interfaces that allow developers to create programs with predictable timing and deterministic program execution.
In this lab, students will undertake a series of exercises that introduce some of these key application interfaces, and allow the development of a simple real-time system. Students will also learn how they can use the Thread Scheduling Visualizer to delve inside their application to see timing relationships and resolve timing issues.
Copyright
Copyright 2009 Sun Microsystems, Inc. All rights reserved. Sun, Sun Microsystems,
the Sun logo, Solaris, Java, the Java Coffee Cup logo, JavaOne, the JavaOne logo,
and all Solaris-based and Java-based marks and logos are trademarks or registered
trademarks of Sun Microsystems, Inc. in the United States and other countries.
Prerequisites
This hands-on lab assumes you have some basic knowledge of, or programming
experience in, the following technologies:
- Java™ language programming, including basic knowledge of threading and synchronization
You will need to
refer to the accompanying presentation 5538_realtimejava.pdf
during the lab.
System Requirements
- Supported OS: Solaris™ Operating System Version 10
- Note: while Sun Java Real-Time System runs on Linux systems with real-time POSIX support (see the Java RTS release notes for the latest supported operating systems) the generation of the visualization data used in Exercises 2 and 4, requires the use of the DTrace tool, which is not available on Linux.
- Memory requirement: see individual software requirements
- Disk space requirement: see individual software requirements
Software Needed For This Lab
Please install the following set of software. If you have any questions on
installation, please feel free to send questions to the lab forum
mentioned below.
- Download and install Sun
Java™ Real-Time System (RTS) — from here
- Follow the instructions supplied with the download to install and
configure Sun Java RTS for your system.
- Download and install JDK™ 6 (needed to run Netbeans™)
- Download and install the Netbeans Integrated Development Environment and the Sun Java RTS Netbeans Module.
- Download and install NetBeans™ IDE 6.5 (this is the version against which the Sun Java RTS Netbeans module has been tested)
- On the download page, choose either the Java SE download, Java download or the All download.
- Download and install the Sun Java RTS Netbeans module by following the links from the Sun Java RTS Download page.
- All the exercises in this lab can be done using an editor of your
choice and the command-line
javac
compiler provided with Sun
Java RTS, but working with the pre-defined projects inside the IDE,
and using the Sun Java RTS Netbeans module,
provides a more comfortable development experience.
- If working outside of Netbeans, the "Thread Scheduling Visualizer" (TSV) can be downloaded at the same time that
you download Sun Java RTS. The documentation for the TSV is here
- Lab-5538 Realtime Java zip file
Notations Used in This Documentation
<INSTALL_DIR>
- It is the installation directory of Sun Java RTS
- For Solaris OS, the default is
/opt/SUNWrtjv
.
- For Linux, you can untar the installation bundle wherever you like.
<lab_root>
- directory into which the lab zip file is
unzipped
- This document uses
<lab_root>
to denote the directory
under which you have unzipped the lab zip file of this hands-on lab.
The name of the lab zip file of this hands-on lab is 5538_realtimejava.zip.
- Once you unzip the lab zip file under
<lab_root>
, it
will create a subdirectory called realtimejava. For example, if
you have unzipped the lab zip file in the /home/sang directory,
it will create the /home/sang/realtimejava directory.
Lab Exercises
Additional Resources
Where To Go For Help
- You can send technical questions via email to the authors of this Hands-on lab (and experts on the subject) or
you can post the questions to the web.
Please post questions and feedback that are relevant to JavaOne hands-on labs at:
- You can send your other questions to the public mailing lists and forums:
Back to top
To exercises