While the Java EE 6 tutorial and the code samples it offers are still work in progress (expect a few rough edges), it's probably a great source for getting up to speed with this update to the Java EE platform. If you've installed the Preview of the Java EE 6 SDK you've probably been encouraged to download an update to the Java EE 6 tutorial:



If you've been using the GlassFish v3 Preview bits from glassfish.dev.java.net then you may be wondering what this is all about as there is no "Tutorial" package or update showing up in the GlassFish updatetool. Whether this is a feature or a bug is yet to be decided but this is technically due to different repositories being wired in for the two different downloads (glassfish vs. SDK). You can check what your repository settings are with to following command (you can visit the URL for an HTML representation of the contents of the repository) :

% pkg authority
AUTHORITY URL
contrib.sun.com http://pkg.sun.com/glassfish/v3/contrib/
contrib.glassfish.org http://pkg.glassfish.org/v3/contrib/
stable.glassfish.org (preferred) http://pkg.glassfish.org/v3/stable/
stable.sun.com http://pkg.sun.com/glassfish/v3/stable/

If you're using GlassFish promoted builds you have a preferred dev.glassfish.org authority (repository) defined as http://pkg.glassfish.org/v3/dev/. If you're running GlassFish v3 Preview (released at JavaOne in May 2009), then it comes with a preferred stable.glassfish.org repository defined as http://pkg.glassfish.org/v3/stable/.

In both cases, in order to be able to see and add the tutorial and sample packages, you simply need to add stable.glassfish.sun.com like this :
% pkg set-authority --enable -O http://pkg.sun.com/glassfish/v3/stable/ stable.glassfish.sun.com

Once that's done, you can list the tutorial and samples packages available for install and proceed with the install :
% pkg list -a | grep javaee
javaee-firstcup-tutorial (stable.glassfish.sun.com) 2.0.1-4 known ----
javaee-javadocs (stable.glassfish.sun.com) 3.0-47.2 known ----
javaee-samples-build (stable.glassfish.sun.com) 0.9-2 known ----
javaee-samples-full (stable.glassfish.sun.com) 0.9-2 known ----
javaee-samples-web (stable.glassfish.sun.com) 0.9-2 known ----
javaee-tutorial (stable.glassfish.sun.com) 6.0.1-9 known ----
% pkg install javaee-firstcup-tutorial javaee-javadocs javaee-samples-build javaee-samples-full javaee-samples-web javaee-tutorial

This will install 17MB worth of samples and tutorial documentation and place this all in your glassfish/samples and glassfish/docs directories.

if you're running GlassFish v3 Preview (which already comes a stable repository) it is important that you then either disable or remove the stable.glassfish.sun.com authority. Failing to do so will cause multiple packages conflict on the next update of GlassFish. Here's how to disable the repository:
% pkg set-authority --disable stable.glassfish.sun.com

Of course you can use the bin/updatetool to accomplish all of the above if you're CLI-averse.



More...