Practical
Embedded Java

Java SE SDK Tools


A practical engineering approach to using embedded Java in real-world applications.


...



Updated 2009 Jan 31

Sun Java tools in the Java SE SDK
Tool Use Description
javac The java compiler.

Javac reads Java class and interface definitions and compiles them into bytecode class files.

When compiling a source file, the compiler often needs information about a type it does not yet recognize. The compiler needs type information for every class or interface used, extended, or implemented in the source file. This includes classes and interfaces not explicitly mentioned in the source file but which provide information through inheritance.

When the compiler needs type information, it looks for a source file or class file which defines the type. The compiler searches first in the bootstrap and extension classes, then in the user class path. The user class path is defined by setting the CLASSPATH environment variable or by using the -classpath command line option. If you use the -sourcepath option, the compiler searches the indicated path for source files; otherwise the compiler searches the user class path both for class files and source files. You can specify different bootstrap or extension classes with the -bootclasspath and -extdirs options.

We will use the -bootclasspath, -target, and -extdirs options when we cross-compile code for J2ME/CLDC.

ref: <JAVA_HOME>/docs/tooldocs/windows/javac.html

java

javaw

The JVM which executes your class files on the PC, and also the Java program launcher.

On the PC, or other interpreted Java platforms, Java launches a program by starting a Java runtime environment, loading a specified class, and invoking that class's main method. The javaw command is identical to java, except that with javaw there is no associated console window. Use javaw when you don't want a command prompt window to appear. The javaw launcher will, however, display a dialog box with error information if a launch fails for some reason.

If a Java program fails to load and start, it can be very frustrating trying to determine the reasons why, since the default error messages are terse and cryptic. The -verbose option provides a lot of information, and will generally be very helpful in debugging program start and load problems.

Our native-execution embedded Java programs will not be started in this way, because the Java runtime environment is in silicon and automatically starts upon power-up. Rather, you specifiy your desired boot class to Jembuilder, and it's main() method executes at any power-up or reset event.

javap The Java class file disassembler. Useful to view the byte codes produced by the java compiler. This gives you a view into how the various Java constructs will actually be executed, and will help you write optimal code for a given situation.
jar The Java archive tool. Used to create a compressed archive of a project, package, or group of related packages.
javadoc The Java documentation tool. Javadoc relies on javadoc tags which are specially formatted comments in your code. Javadoc produces a corresponding set of HTML pages describing (by default) your program's public and protected classes, nested classes (but not anonymous inner classes), interfaces, constructors, methods, and fields. You can use it to generate the API (Application Programming Interface) documentation or the implementation documentation for a set of source files.
jre Java Runtime Environment Used by executable Java programs, the JRE is a bundle of the Java Virtual Machine (JVM) and other support files which are specific to a given platform such as Windows, Mac or Linux. Many programs install their own JRE (e.g. WinAmp, FireFox) so there are probably multiple copies - some rather old - in your execution path. So be sure your PATH system variable points first to the one you want to be used by your Java programming tools. The JRE is sufficient to run Java applications but not to compile them.
jdb Java debugger JDB is a simple command-line debugger for Java classes. It is a demonstration of the Java Platform Debugger Architecture that provides inspection and debugging of a local or remote Java Virtual Machine.

 
Systronix® 939 Edison St, Salt Lake City, Utah, USA 84111
Tel +1-801-534-1017, Fax +1-801-534-1019
contact us     Time Zone: MDT (UTC-6)
 

Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
Systronix is independent of Sun Microsystems, Inc.
TStik, JStik, JCX, JStamp, JSimm, JDroid, and JRealTime are trademarks of Systronix, Inc.
1-Wire, iButton and TINI are trademarks of Dallas Semiconductor
Simmstick is a trademark of Dontronics
LEGO® is a trademark of Lego A/S, Denmark