Home : Course Map : Chapter 1 : Java :
Programming Tools
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

You can choose from essentially two different programming environments for Java:

  • Manual - with your favorite text editor (see below) create the Java source code files (*.java) and then use the command line tools in the Java Software Development Kit (SDK). The SDK is provided by Sun for several platforms and includes a number of tools, the most important of which are:

    • javac - compiles Java source code files (e.g. Test.java) to bytecode files (e.g. Test.class)
    • *

    • java - runs Java application programs (i.e. implements the JVM for the Java programs.)

    • appletviewer - tests applets independently of a browser.

  • Integrated Development Environment (IDE) - graphical user interface programming environments (often called GUI Builders) are elaborate, programs that allow you to interactively build graphical interfaces, edit the code, execute and run the applets and applications all within the IDE system. Example Java IDEs include:

    • NetBeans - free, open source Java IDE - can be installed along with the SDK.
    • Borland JBuilder - proprietary but the personal version is free with registration

     


Note: During this course we recommend the manual approach so that you will learn the details of the Java graphics system. While it is fine to use the editor in the GUI Builder (see below), you should write all of the code yourself rather than using the interactive window building tools. Otherwise, the GUI builder will do most of the work for you and you will learn very little.

Later when you begin developing your own programs with elaborate graphical interfaces, you probably will want to use the a GUI builder. However, even then you will occasionally want to modify the graphics code by hand to debug a problem, for example, or tweak the look of a window layout. So you need to understand graphic programming well to do this.


Other suggestions:

  • Source Code Editors: For editing your programs, we recommend a language sensitive editor that color codes the Java text. Keywords, strings and other items will be highlighted. This helps to avoid simple spelling mistakes and assists debugging.

    Examples include:

    • JEdit - open source program written in Java
    • vim - a version of the Unix vi editor. Available for Unix & MS-Windows

  • Applet Tools: applets are intended primarily to run in browsers. However, It is usually more convenient to use the appletviewer program, which comes with the SDK, during debugging and tuning of your applets. It is a command line program that is specialized for running applets. It only needs an HTML page with the applet tag for the particular applet of interest.

    Once your applets work satisfactorily with appletviewer, you can examine how they appear in the browser.

    With the older JVMs that came installed in the browsers, it could be difficult to force the browser to load a new class file rather than use the old one in the cache. With Sun's Java Plug-in, which should have been installed into your browsers when you installed the SDK and is also available for downloading from www.java.com, the console window allows for various commands to the JVM including the "x" command that clears the cache.

* javac Target Option

The javac compiler includes the option "-target" to specify that the class file be compatible with a particular JVM for an earlier version of Java. For example,

> javac -target 1.1 HelloWorld.java

will insure that the class file will run in Java 1.1 virtual machines.

 

Latest update: Oct.10.2004

            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.