Home : Map : Chapter 1 : Java : Tech : Physics :
Java in Physics:
Benefits & Shortcomings
Course Map
Chapter 1
What is Java?
Java 5.0

Java Process
Getting Started
Simple Applet
Simple Application


Making WebPages
Java 5.0 Features
Advanced JVMs
Alt. Compilers
Alt. JVMs
Java Deployment

     About JavaTech
     Codes List
     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.


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.


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

Java in Science
    & Engineering
RealWorld Examples

Java in Physics
Sim. in Experiments
  Demo 1: Event
  Demo 2: Continuous
  Demo 3: Static

Learn by Coding

  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
22 23 24

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.