Using Tiger
You now have a full 1.5 release -- at least with what Sun provided with this early access release. To use the release, you'll need to add the installation directory to your path and change any related environment variables, as shown in Listing 1:
Listing 1. Setting Windows environment variables |
The first line sets the JAVA_HOME environment variable to where Tiger was installed. The second line says to add the bin directory under this installation directory to your path.
After setting the environment variables, you can run java -version to make sure you set everything properly, as shown in Listing 2:
|
To try out the new release, we'll use the test code from last month's column. Grab the code and try compiling it without loading any special libraries. You'll need to compile the code with the -source 1.5
command-line switch. You'll find that there were some changes from the
early access version to what made it to this alpha release, though who
knows just what will hit the streets at beta time. For instance, just
trying out the enumeration example reveals the VALUES constant is now a values() method, and it returns an array instead of a List. Also, the switch case labels changed to just the unqualified name as the constant. Listing 3 shows a modified EnumTest class from last month's examples (available in Resources):
|
Listing 4 shows the compilation step and running of Listing 3 (the -source 1.5
tag is only required at compile time):
|
The true on line four of the output in Listing 4 indicates that the type returned by calling
values() is of type Color[ ].
About that documentation
As I said before, there is no documentation. While I have yet to find
anyone who's posted the 1.5 Javadoc on the Web, you can generate it
yourself; see Resources) for a tip on how to use Ant for this purpose. Change the JDK_HOME in the build script (an example is provided in the source download in Resources) to where you installed the SDK, change PLATFORM_EXTENSION to exe for Windows, change JDK_MAJOR_VERSION to 1.5, and run Ant from where you created the build.xml file. This step will unzip the src.zip file that comes with the installation and
run javadoc on the java, javax, and org packages.
Note: Give the program some time to run. It took approximately 17 minutes to run on my two-year-old machine, apart from the unzipping. Closing excess programs will help free up memory for it to run. Don't worry about any warning messages (I got close to 3000; at this point, we'll take what we can get).
We'll look at what's new in what this generates in future installments of this column (like the java.io.Closeable interface and new java.util.Queue collection). You'll find the generated Javadoc output in the new docs directory under the installation directory (JDK_HOME).
View Taming Tiger: Prerelease of Tiger Discussion
Page: 1 2 3 4 Next Page: Conclusion And Resources