Running Java Swing on JDK 1.2 on Dept Sun Workstations
JDK 1.2 has been installed on all the Sparc 5 Sun Workstations in Lab C 2.08.
NOTE JDK 1.2 will not currently run on the few Sparc 4 machines.
Configuring your user path for JDK 1.2
You must configure you default path in order to access and run JDK 1.2.
To do this:
- Edit or create a file called .cshrc.mine in your top level (home) directory. ls .cshrc.mine will indicate if it exists or not. Use any text editor to edit/create the file.
- Alter the path by adding the line or changing an existing path by:
set path = (/usr/java1.2/bin $path)
If you intend to use the current terminal then you must
source .cshrc.mine
NOTE:
- You NEED only do this once as all other new terminal windows will have the correct path set.
- Once set you cannot use Sparc 4 Workstations to run Java Swing --- unless you change this back (not recommended)
To verify that you are running the correct version of JDK type
java -version
You should get Version JDK1.2
Running JDK1.2/Swing from Sparc 4 Workstations
This cannot be directly done. It is NOT recommended that you revert back to JDK1.1.
If you can only gain access to a Sparc 4 machine in the lab then:
- rlogin or remoteterm to an appropriate Sparc 5 machine.
Changing Swing Programs for JDK 1.2
You may need to change some of the source programs designed to run for JDK1.1.
This includes many of the book examples and some examples used in the lectures.
You can do this as follows:
- Change all references to com.sun.java.swing to javax.swing
- EXCEPT References to com.sun.java.MotifLookAndFeel, com.sun.java.WindowsLookAndFeel look and feel UIManager.setLookAndFeel() parameters. NOTE The Metal look and feel is changed to javax.swing.plaf.metal.MetalLookAndFeel however.