Prepare yourself for what's new and different in the forthcoming JDK 1.2 release

Core Java continues to grow and grow, but you'll be ready for the new release -- with JavaWorld's detailed analysis of all the additions

1 2 3 4 Page 4
Page 4 of 4

Once you've read the file into a buffered image, you can manipulate it, and later save it back out. Saving allows you to set JPEGEncoderParam data like image quality, or you can just use the defaults, as follows:

FileOutputStream fos = new FileOutputStream ("imagefile.jpg");
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder (fois);
encoder.encode (bi);

What happened to servlets?

When JDK 1.2 was first announced, the servlets package (

javax.servlet

) was supposed to be included as a standard extension with the 1.2 development and runtime environments. At some point, Sun decided it was best left packaged separately, in the Java Servlet Development Kit (JSDK). The 2.0 JSDK is the latest release, and works with both JDK 1.1 and JDK 1.2. When creating servlets, be sure to use the version of Java technology supported by your servlet-enabled Web server.

The only deprecation change between the 1.x and 2.x servlet packages is the getServlets() method of ServletContext, which has been deprecated in favor of the getServletNames() and getServlet() methods.

If you've been using the 1.x JSDK, the biggest changes you'll see in the move to the 2.x JSDK include delegation of different request types to specific methods (like doGet and doPut) of HttpServlet, the addition of Reader and Writer support with ServletRequest and ServletResponse, as well as the addition of the SingleThreadModel interface to indicate a servlet should implement service requests in a single-threaded manner.

Browser support

For now, browser support for JRE 1.2 will be provided with Sun's Java Plug-in. This immediately enables JRE 1.2 within Netscape Navigator 3.0/4.0 under Windows (NT/95/98) or Solaris (SPARC and x86 (3.0 only for x86)), as well as Internet Explorer under Windows (4.0 for NT/95/98 and 3.02 for NT and 95). Until the Sun vs. Microsoft Java lawsuit has been resolved, you shouldn't expect to find JRE 1.2 support in Internet Explorer directly from Microsoft. As far as Netscape goes, rumor has it that the company plans to include the Plug-in with a future release of its browser software, instead of requiring the separate installation of the tool.

Conclusion

With the JDK 1.2 FCS release soon upon us, there is much to learn if you wish to stay current with the third generation of Java technology development. This article highlights key areas you'll want to continue exploring on your own. The good news is that, with the sole exception of security-related code, everything should recompile and run fine under the 1.2 environment. Hopefully, 1.2 will run faster than, or initially at least as fast as, JDK 1.1. While Sun has delayed the FCS for some time now, it appears JDK 1.2 will serve as a complete development environment with a polished API set.

Rick Ross, president of Java Lobby, commented that Sun "has to fix today's problems before adding more improvements" and said Sun was "right to hold off delivery of JDK 1.2 to achieve a lower-memory footprint and better performance." Ross said performance is key, "particularly for people creating applications competing with natively compiled code." Hopefully, by the time JDK 1.2 comes out, with capabilities like a feature-complete Swing implementation and better performance, Java developers will be happy. JDK 1.2 offers many new features, and if Sun can keep to its promised numbers, Frank Pittelli claims, "Java 1.2 will achieve wide scale acceptance and will be able to serve as the basis for millions of development projects over the next few years."

John Zukowski is a software mage with MageLang Institute, author of Mastering Java 1.2, Java AWT Reference, and Borland's JBuilder: No experience required, as well as the Focus on Java guide at The Mining Co.

Learn more about this topic

  • Java 1.2 home http://java.sun.com/products/jdk/1.2/
  • Java 1.2 documentation http://java.sun.com/products/jdk/1.2/docs/index.html
  • JDK 1.2 features guide http://java.sun.com/products/jdk/1.2/docs/guide/index.html
  • Sun's official discussion of JDK software compatibility http://java.sun.com/products/jdk/1.2/compatibility.html
  • Create servlets with the help of the Java Servlet Development Kit http://jserv.java.sun.com/products/java-server/sdk/index.html
  • Learn about javadoc enhancements and how to create doclets http://java.sun.com/products/jdk/1.2/docs/tooldocs/javadoc/index.html
  • Java Plug-in for Java 1.2 support in browsers http://java.sun.com/products/plugin/
  • Java Tip 46"Use Java 1.2's Authenticator class" http://www.javaworld.com/javaworld/javatips/jw-javatip46.html
  • The Java Lobby http://www.javalobby.org
  • RSA Data Security Inc., Java security solutions provider http://www.rsa.com
  • ChartWorks, Java charting solutions provider http://www.chartworksinc.com/
  • Apptivity, Java-based data access tool provider http://www.apptivity.com
  • Sample doclet and output http://www.javaworld.com/jw-11-1998/jdk12/jw-11-jdk12.zip
  • Drag and drop how-to, beta-4 style http://java.miningco.com/library/weekly/aa072398.htm
  • For CORBA information from the source, visit the Object Management Group http://www.omg.org/
  • The Generic Collection Library for Java, an alternative set of collection classes http://www.objectspace.com/jgl/
  • Sun's Java Tutorial"Thread Deprecation Changes in Java 1.2" http://java.sun.com/docs/books/tutorial/post1.0/preview/threads.html
  • The JavaBeans Glasgow Draft Specifications http://java.sun.com/beans/glasgow/
  • Read about the Java 1.2 beta 4 security changes in "New API for Privileged Blocks" http://java.sun.com/products/jdk/1.2/docs/guide/security/doprivileged.html
  • Check out "Reference Objects and Garbage Collection," one of many great technical articles on the JDC (registration required -- it's free) http://developer.java.sun.com/developer/technicalArticles/monicap/RefObj/refobj.html
1 2 3 4 Page 4
Page 4 of 4