Migrate to Java SE 6
This product version supports the Java SE 6 specification. Its Java virtual machine provides a Java language compiler and runtime environment. Decide whether the new and existing applications will take advantage of the capabilities added by Java SE 6, adjust the just-in-time (JIT) mode if necessary, and begin the transition from deprecated functions.
The following JSRs are new in Java SE 6:
- JSR 105: XML Digital Signature Application Programming Interfaces (APIs)
- JSR 173: Streaming API for XML (StAX)
- JSR 181: Web Services Metadata
- JSR 199: Java Compiler API
- JSR 202: Java Class-File Specification Update
- JSR 221: Java DataBase Connectivity (JDBC) 4.0
- JSR 222: JAXB 2.0
- JSR 223: Scripting for the Java Platform
- JSR 224: JAX-WS 2.0
- JSR 250: Common Annotations
- JSR 269: Pluggable Annotation-Processing API
The new virtual machine specification adds several features and functions to benefit application developers, such as interfaces for integrating the Java and scripting languages, password prompting, file input-output enhancements, and parsing of streaming XML documents.
- Determine whether to use the default just-in-time (JIT) mode.
For Java SE 6, the default JIT mode for the Solaris virtual machine depends on the hardware configuration. It is not always client. With Java SE 6, for server class hardware (meaning 2+ CPU and greater than 2 GB RAM), the virtual machine automatically switches to server JIT mode.
To configure the -server or -client parameter to the liking, set the generic Java virtual machine arguments of the server process definition. See Java virtual machine settings.
- Decide whether to take advantage of new Java SE 6 capabilities in the applications.
We can deploy applications using Java SE 6 features only to Version 7 or later nodes, as earlier product versions do not provide the Java SE 6 virtual machine.
Applications that access classes and APIs internal to the Java virtual machine might produce errors. These classes and APIs are not covered by the Java SE 6 specification and are therefore subject to change. Direct use of implementations of XML and XSL parsers is strongly discouraged, such as direct use of Xerces and Xalan classes that provide the Java API for XML Processing (JAXP) implementation for the virtual machine. The direct parser APIs also are considered internal and subject to change. Applications should rely only on the JAXP APIs defined in the Java SE 6 API documentation. If the application requires a specific version of Xerces or Xalan, or some other XML/XSL parser package, then embed the parser within the application's WEB-INF/lib directory and set the appropriate class loading mode in the application deployment so that for the application the XML parser APIs are loaded from the application class path, not the Java virtual machine bootstrap class path. Failure to follow this guideline can cause significant errors when you try to migrate to a new Java SE 6 level.
- Compile Java SE 6 applications to run on previous Java virtual machine levels by setting the compiler modes.
When compiling applications that are built with Java SE 6 that are intended for running on previous specifications, specify -source and -target modes for the Java SE 6 compiler. Doing so ensures that the bytecode generated is compatible with the earlier Java virtual machine.
For example, if the target Java virtual machine is at 1.4.2 level, when you compile applications with Java SE 6, you should specify -source 1.4, and target 1.4 to generate bytecode compatible with 1.4.2. This does not handle the usage of packages, classes, or functions new to Java SE 6. It only addresses bytecode output. Developers must take care in what APIs they are using from the J2SE packages if they intend to run the application on multiple Java virtual machine specification levels.
- Address incompatibilities in previously compiled Java 2 Standard Edition (J2SE) 1.4 and 5.0 applications.
Java SE 6 is upwards binary-compatible with Java 2 Technology Edition, Version 5.0 and Java 2 Technology Edition, Version 1.4.2, except for the incompatibilities documented by Oracle Corporation at http://java.sun.com/javase/technologies/compatibility.jsp.
- Transition from deprecated Java Virtual Machine Debug Interface (JVMDI) and Java Virtual Machine Profiler Interface (JVMPI) functions to Java Virtual Machine Tool Interface (JVMTI).
Deprecated feature: JVMDI and JVMPI functions were deprecated in J2SE 5.0. They have been removed from Java SE 6.depfeat
- Update the use of the Java command line interface.
The command-line interfaces for the Java SE 6 level have not changed extensively from J2SE 5, although they vary among virtual machine vendors. We can find them in the JAVA_HOME/bin directory. Here are some notable command line options that are standard to all Java SE 6 implementations.
- For JVMTI, use -agentlib to load a native agent library specified.
- For JVMTI, use -agentpath to load the native agent library by the full path name.
- For JVMTI, use -javaagent to load the Java programming language agent (see java.lang.instrument for details).
- See apt -help for information about this new command line supporting the annotations capability.
- See javac -help for information and updates to that command line.
- Update ANT tasks.
If we have created ANT tasks based on the idltojava ANT task shipped with prior versions of this product, ensure that it passes the proper parameters for Java SE 6 as it does for J2SE 1.4 or 5, to ensure the stubs, ties and skeletons that it generates are compatible with earlier product releases.
Java virtual machine settings
Related information:
Java SE
Java SE compatibility