Home : Course Map : Chapter 23 :
Chapter 23: Outside the JVM
JavaTech
Course Map
Chapter 23

Access Platform
System Properties
  Demo 1
Run Ext. Programs
  Demo 2
Java Comm API
Port Classes
Port Operations
  Demo 3   Demo 4   Demo 5
Serial Port IO
Demo: Serial Port
  Code Listings

    Demo 6
Parallel Port
Port I/O Apps
Exercises

     About JavaTech
     Codes List
     Exercises
     Feedback
     References
     Resources
     Tips
     Topic Index
     Course Guide
     What's New

Java programming often seems to take place in a safe and isolated sandbox, as the Java Virtual Machine is often called. The sandbox makes for a secure system. The class loading process checks the files for pathologies, there are no direct memory pointers, and the security manager can block access to some or all outside resources. In fact, for an applet the sandbox is so tightly secure that, except for special setups, it can access almost no resources and can modify none.

Applications, however, even though they also run in the JVM sandbox, obviously need the capability to communicate with, access, and modify the real machine to do useful tasks.

A program can reach outside the JVM via:

  • Standard I/O
    In Chapter 9: Java we discussed streams, the File class, file choosers, and other tools and techniques for input/output with the local platform.

  • Networking
    In Part II: Chapters 13-21 we examined sockets, URL connections, RMI, and other tools for communications with other platforms on the local network and the Internet.

  • JNI
    In Chapter 22 we looked at the JNI framework for connecting Java to native code programs in C. This reduces the portability of an application, but allows for direct access to the system.

  • ClassLoader
    The ClassLoader obtains classes from the local disk, JAR files, and other locations and loads them into the JVM. Its getResources() method, invoked from a ClassLoader object or from the Class class, can also be used to obtain images, sound clips, and other files.

  • Windows Toolkit
    The AWT toolkit object discussed in Chapter 12 provides information on the display system, such as the screen resolution, screen size, and so forth.

In this chapter we look at some other techniques to access the world outside the JVM:

 

Latest update: Dec. 12, 2004

  
  Part I Part II Part III
Java Core 1  2  3  4  5  6  7  8  9  10  11  12 13 14 15 16 17
18 19 20
21
22 23 24
Supplements

1  2  3  4  5  6  7  8  9  10  11  12

Tech 1  2  3  4  5  6  7  8  9  10  11  12
Physics 1  2  3  4  5  6  7  8  9  10  11  12

Java is a trademark of Sun Microsystems, Inc.