Core Java Technologies Tech Tips Tips, Techniques, and Sample Code Welcome to the Core Java Technologies Tech Tips for June 17, 2005. Here you'll get tips on using core Java technologies and APIs, such as those in Java 2 Platform, Standard Edition (J2SE). This issue covers: * Beyond J2SE 5.0 * Collaborating with Sun on Mustang These tips were developed using a snapshot release of Java 2 Platform, Standard Edition (J2SE 6.0), code name Mustang. You can download a snapshot release of Mustang at https://mustang.dev.java.net/. This issue of the Core Java Technologies Tech Tips is written by John Zukowski, president of JZ Ventures, Inc. (http://www.jzventures.com). You can view this issue of the Tech Tips on the Web at http://java.sun.com/developer/JDCTechTips/2005/tt0617.html See the Subscribe/Unsubscribe note at the end of this newsletter to subscribe to Tech Tips that focus on technologies and products in other Java platforms. For more Java technology content, visit these sites: java.sun.com - The latest Java platform releases, tutorials, and newsletters. java.net - A web forum for collaborating and building solutions together. java.com - Hot games, cool apps -- Experience the power of Java technology. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BEYOND J2SE 5.0 J2SE 5.0 was released in September 2004. Its successor, Java 2 Platform, Standard Edition (J2SE 6.0), code name Mustang, is due in the first half of 2006. The Mustang release is managed through the Java Community Process as JSR-270 (http://www.jcp.org/en/jsr/detail?id=270). The themes of this new release continue many of the J2SE 5.0 themes and add some new ones: o Compatibility and Stability o Diagnosability, Monitoring, and Management o Ease of Development o Enterprise Desktop o XML & Web Services o Transparency Although Mustang won't be available until next year, you don't have to wait until then to start using Mustang code. Sun has been releasing weekly snapshots of the full Mustang source code, javadoc, and binaries on java.net, the Java technology collaboration portal (https://mustang.dev.java.net/). This gives you access today to the next generation of the Java platform. If you want to get a source code drop of Mustang, you must agree to the Java Research License (JRL) (http://www.java.net/jrl.csp). Instructions are provided for building the J2SE 6.0 early access software for the following operating environments: o Solaris (http://www.java.net/download/jdk6/build-solaris.html). The official build platform listed in the instructions is Solaris 8. o Linux (http://www.java.net/download/jdk6/build-linux.html). The official build platform listed in the instructions is Redhat Enterprise Advanced Server 2.1 update 2. o Windows-i586 (http://www.java.net/download/jdk6/build-windows-i586.html) The official build platform listed in the instructions is Microsoft Windows 2000. Later releases of these platforms can also be used for builds. If you want to receive the javadoc, you have the option of downloading a 30 megabyte jar file, or you can view the documentation online (http://www.java.net/download/jdk6/docs/api/). There are @since tags in the source code javadocs. These identify things that are new for J2SE 6.0. The binary distribution is platform-specific and is available on the JDK 6 Binary Snapshot Releases page (http://www.java.net/download/jdk6/binaries/). Download the file specific to your platform. Most files range in size from 40-to-50 megabytes. After the download is complete, an InstallShield wizard will guide you through the setup process. Review the click-through pre-release software evaluation agreement. If you agree, press the Accept button. Because the release is early access software, you might not want to replace the browser plug-in (the Public JRE folder). Feel free to not install that feature. Do at least install the source, binaries, and demos. The default installation directory on the Windows platform is C:\Program Files\Java\jdk1.6.0. Select Change if you want to relocate the base path. If you are happy with the installation location and options to install, press Next. After the installation is complete, you can try out the new software. Windows users will need to reboot their system. You should then add the bin directory under the installation directory to the PATH for your platform. Then display the level of the Java platform to make sure that the runtime environment is found and to verify a proper configuration. Enter the command "java -version". What gets displayed in response depends on the version of the binary distribution you downloaded: >> java -version java version "1.6.0-ea" Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-ea-b38) Java HotSpot(TM) Client VM (build 1.6.0-ea-b38, mixed mode, sharing) For information on what's changed in the Mustang builds, see (https://mustang.dev.java.net/servlets/ProjectDocumentList?folderID=2855). Keep in mind that the software is early access and not all the documentation has been updated. For instance, as of build 38, the README file is still for JDK 5.0. Also, just because something is in an early access release, it doesn't necessarily mean that it will be available in the final version. The JSR 270 expert group will have final determination on what is included in Mustang. There are many things you can do with the downloaded software. For example, you can see if your least favorite bug has been fixed. You can find a list of bug fixes, grouped by category, on the Bugs Committed in Mustang Release page (https://mustang.dev.java.net/MustangCommittedBugs.html). If you see that a bug hasn't yet been fixed, you can also take the fix-it-yourself approach. Information on collaborating with Sun and offering your bug fixes are available at https://mustang.dev.java.net/collaborate.html. J2SE 6.0 isn't open source, but "jdk researcher" roles are available for those interested in participating. The next tip, "Collaborating with Sun on JDK 6.0, discusses how you can contribute to JDK 6.0. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - COLLABORATING WITH SUN ON MUSTANG One of the reasons for making early releases of Mustang source code available is to encourage developers to contribute to the code, and in that way add to the robustness and stability of the platform. You can now contribute enhancements and bug fixes to JDK 6.0. You don't have to rely on submitting feature requests or logging bug reports, and then waiting for Sun to address those submissions. Guidance on how to make contributions is provided on the "How to Collaborate with Sun on Mustang" page (https://mustang.dev.java.net/collaborate.html). The first step listed on that page is to download the Mustang source code and binaries. However before doing that, it's a good idea to confirm that the contribution (bug fix or enhancement) you want to make hasn't already been implemented. With the 40+ weekly drops of Mustang code, it is possible that Sun or another contributor has made the enhancement or fixed the bug. If the enhancement has been made, or the bug fixed, there's no reason to proceed with the process for that contribution. You can see a list of committed bug fixes as of the latest snapshot release at https://mustang.dev.java.net/MustangCommittedBugs.html. For a list of fixes that are integrated in each snapshot, see https://mustang.dev.java.net/servlets/ProjectDocumentList?folderID=2855. You can also see the list of fixes that are integrated in each snapshot, by clicking on the "Summary of changes in Mustang" link on the Mustang project home page (https://mustang.dev.java.net/). If you know the bug number of a bug (for instance, because you submitted the bug report), you can go to the Bug Database (http://bugs.sun.com/bugdatabase/) and check it's status. If the status is listed as "In progress", there's no reason to continue with the contribution process for that bug fix. After downloading the source code, you need to apply for the role of jdk.researcher. You apply on the "Project Membership/Role Request" page (http://jdk.dev.java.net/servlets/ProjectMembershipRequest). If you are not yet a java.net member, you need to apply for membership at https://www.dev.java.net/servlets/Join. Terms of the jdk.researcher role are described on the "Join this project" page (https://jdk.dev.java.net/terms.html). The terms include acceptance of the Java Research License (http://www.java.net/jrl.csp) and the java.net web site Terms of Participation (http://java.net/terms.csp). After your project role request is approved (which should happen within one business day), you can go to the jdk-collaboration project page (http://jdk-collaboration.dev.java.net/). You can't see the project information until your role request is approved. Next, you need to print, read, sign, and fax (to 650-482-6557) the Sun Contributor Agreement (http://jdk.dev.java.net/Sun_Contributor_Agreement.pdf). The agreement provides Sun with the rights it needs to distribute your contributions to others. You can also scan the document and email a signed agreement to jdk-contributions@sun.com. Please write clearly. After acceptance as a jdk.researcher and receipt of the fax, your project role becomes jdk.contributor. You are now able to submit your contributions. When you contribute an enhancement or bug fix, you need to provide the necessary data for a senior Sun engineer to review the submission and validate its correctness. In other words, don't just submit "change line 2 of file Foo.java to blah blah blah." You should also include something (say a unit test) that verifies the existence of the problem, and verifies that the bug fix indeed fixes the problem. Think small when writing unit tests. If you encountered the bug in the middle of 10,000 lines of source code, create a test case that isolates the issue to the pertinent lines of code. Some example contributions for bug fixes are shown at https://mustang.dev.java.net/example-contribution.html. Don't forget to include the bug number or incident number with the correction. If you don't have a bug number or incident number, submit a bug report first at http://java.sun.com/webapps/bugreport. You can view a flowchart of the contribution process at https://mustang.dev.java.net/images/process.png. For additional information on the different roles in a java.net project, see the JDK Community Governance Guidelines (https://jdk.dev.java.net/governance.html). A good place to get answers to questions about Mustang is the Mustang forum (http://forums.java.net/jive/forum.jspa?forumID=23). . . . . . . . . . . . . . . . . . . . . . . . IMPORTANT: Please read our Terms of Use, Privacy, and Licensing policies: http://www.sun.com/share/text/termsofuse.html http://www.sun.com/privacy/ http://developers.sun.com/dispatcher.jsp?uid=6910008 * FEEDBACK Comments? Please enter your feedback on the Tech Tips at: http://developers.sun.com/contact/feedback.jsp?category=sdn * SUBSCRIBE/UNSUBSCRIBE Subscribe to other Java developer Tech Tips: - Enterprise Java Technologies Tech Tips. Get tips on using enterprise Java technologies and APIs, such as those in the Java 2 Platform, Enterprise Edition (J2EE). - Wireless Developer Tech Tips. Get tips on using wireless Java technologies and APIs, such as those in the Java 2 Platform, Micro Edition (J2ME). To subscribe to these and other JDC publications: - Go to the Sun Developer Network - Subscriptions page, (https://softwarereg.sun.com/registration/developer/en_US/subscriptions), choose the newsletters you want to subscribe to and click "Submit". - To unsubscribe, go to the Subscriptions page, (https://softwarereg.sun.com/registration/developer/en_US/subscriptions), uncheck the appropriate checkbox, and click "Submit". - To use our one-click unsubscribe facility, see the link at the end of this email: - ARCHIVES You'll find the Core Java Technologies Tech Tips archives at: http://java.sun.com/developer/TechTips/index.html - COPYRIGHT Copyright 2005 Sun Microsystems, Inc. All rights reserved. 4150 Network Circle, Santa Clara, California 95054 USA. This document is protected by copyright. For more information, see: http://java.sun.com/developer/copyright.html Core Java Technologies Tech Tips June 17, 2005 Trademark Information: http://www.sun.com/suntrademarks/ Java, J2SE, J2EE, J2ME, and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.