The JavaTM Tutorial
Previous Page Lesson Contents Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Trail: JDK(TM) 1.1 -- And Beyond!
Lesson: Migrating to 1.1

Platform-specific Details: Using the updateAWT Script

Here's an example of using the updateAWT script to help convert a 1.0 AWT program to the 1.1 API. The example shows the commands you might enter at a shell prompt on a UNIX system.
  1. Run the script:
    % cp MyClass.java OldMyClass.java
    % updateAWT MyClass.java > tmp.java
    

  2. Check the changes to make sure nothing obviously bad happened. For example, on a UNIX system, you might execute the following command:

    % diff MyClass.java tmp.java
    

  3. After confirming that the changes look OK, save the new version of the program:
    % mv tmp.java MyClass.java
    

  4. Try recompiling the program to make sure that the script didn't incorrectly convert a method name. Be sure to use a 1.1 compiler.
    % javac MyClass.java
    
    You might still get a few deprecation warnings, but you shouldn't get any compile errors.

  5. If the program doesn't compile, you probably have to undo a change the script made. See Simple Name Changes for help.

Previous Page Lesson Contents Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Copyright 1995-2004 Sun Microsystems, Inc. All rights reserved.