Home : Map : Chapter 1 : Java : Tech : Physics :
Java in Physics:
Benefits & Shortcomings
JavaTech
Course Map
Chapter 1
Introduction
History
What is Java?
Versions
Java 5.0
Features

Java Process
Tools
Documentation
Compatibility
Getting Started
Simple Applet
Simple Application
Starters
Exercises

    Supplements
Interpret/Compile

Making WebPages
Plug-in
Java 5.0 Features
The JVM
Advanced JVMs
Alt. Compilers
Alt. JVMs
Java Deployment

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

As with general science and engineering, Java offers a number of benefits in physics computations and also some shortcomings.

Benefits

The graphical capabilities of Java provide great flexibility and a wide array of tools for implementing simulations. Such graphical simulations can often illustrate a phenomena far more clearly than just by studying the underlying equations.

The portability of Java code allows theorists who collaborate but work on different platforms to easily share code.

Many physics legacy programs in Fortran and C can benefit from attaching a Java graphical interface and also by using Java's networking capabilities. Most of these legacy programs, especially those involving extensive numerical computation programs, represent huge numbers of person-hours of work and will never be rewritten from scratch in another language. However, by giving them a Java interface, their usability and accessibility vastly increases. (Chapters 16-20 will discuss how to use Java to interface to a legacy computational engine over the web.)

Experimentalists often work on hardware systems that include a wide range of platforms: Linux workstations, MSWindows PCs, embedded processors in remote sensors, etc. Using programs that can run on all of these platforms can greatly simplify software development.

Here, as well, experimentalists can build networking programs with Java that allow distributed sensors to share data, allow for remote diagnostics and calibrations, monitoring of data as it is recorded, and so forth. In Chapter 23 we will focus on embedded Java.

Shortcomings

Until recently the lack of an official real-time specification slowed the development and broad use of Java real time JVMs in many data taking systems. Java in real-time applications have linked with native code (see Chapter 21) to carryout real-time operations. Now, however, an official specification has been agreed upon and we can expect to see a number of real time JVM's become available, especially for small footprint, embedded platforms.

The lack of a 2-D array, array index checking, and no complex primitive type are inherent shortcomings in Java that can seriously affect some highly computationally intensive computations. However, in such cases, Java can still provide a powerful interface to a numerical module written in C or Fortran.

Similarly, linking to C or Fortran might overcome the general problem of slow performance in the JVM. However, this problem has become less acute with the development of sophisticated optimizing compilers that transform Java bytecodes to native machine code. With such compilers, it's possible that some Java programs can run even faster than similar code in C or Fortran.

Latest update: Dec.10.2003

            Tech
Java in Science
    & Engineering
Benefits
Shortcomings
RealWorld Examples

           Physics
Java in Physics
SimulationTypes
Simulate&Analyze
Sim. in Experiments
  Demo 1: Event
  Demo 2: Continuous
  Demo 3: Static

Learn by Coding
Exercises

  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.