Acquiring the Scanner class for Java 1.4 on Apple Macs
IMPORTANT: If you are running Tiger (Mac OS X 10.4.2), Java 1.5 is now available for download (click here to go to the download page). We strongly suggest that you upgrade to Tiger and install Java 1.5, to avoid problems. If you decide not to install Tiger, follow the instructions on this page to add to your Java library a version of Java 1.5's Scanner class. Although using such modified library should allow you to do homeworks that would otherwise require Java 5.0, the provided Scanner class has limited functionality, and we cannot exclude that it may behave incorrectly in some cases.
Open a terminal window (Applications -> Utilities -> Terminal) and execute java -version This should print something like: java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.3) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) If the version is different from "1.4.2_05", stop here and ask for assistance. Otherwise, execute the following commands: cd /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes sudo mv classes.jar classes.orig.jar sudo curl http://endeavor.cc.gt.atl.ga.us/classes.cs1322.JDK1.4.2.jar -O sudo chmod 644 classes.cs1322.JDK1.4.2.jar sudo ln -s classes.cs1322.JDK1.4.2.jar classes.jar That's it. To make sure that everything worked fine, execute again java -version and check that you don't get any error. If you get an error at this point or after any of the commands above, ask for assistance.
Copyright © College of Computing
Any unauthorized reproduction or use is strictly prohibited.