Tuesday Feb 19, 2013

Migrating from Java SE 6 to Java SE 7

Why should I migrate from SE 6 to SE 7?

The most obvious reason is that you will get access to all the new features and improvements that we have made to Java with the introduction of Java 7.

A few of these changes might require some updates to your code, but they are changes that are well worth it from a performance, quality and readability perspective. You can find more information here: http://docs.oracle.com/javase/7/docs/webnotes/adoptionGuide/index.html

Another important reason is the End of Public updates milestone for Oracle JDK 6. After February 2013, future JDK 6 updates will no longer be publicly available and old JDK 6 releases will me moved to the Java Archive. Running on an old version of Java is a bad idea, so now is the time to move to 7. For more information on the End of Public Updates milestone, see Java SE End of Life Policy

If you are unable to migrate some of your applications and need continued access to Oracle JDK 6 updates, Oracle offers long-term support through the Java SE Support program.

What do I need to do?

Option 1 – “Just run”

Java has binary backward compatibility. This means that if you have a program that has been compiled for and is running with Java SE 6, it will also run on a Java SE 7 JVM. Java SE 7 is strongly compatible with previous versions of the Java platform. Almost all existing programs should run on Java SE 7 without modification. However, there are some minor potential incompatibilities in the JRE and JDK that involve rare circumstances and "corner cases" that are documented here for completeness: http://www.oracle.com/technetwork/java/javase/compatibility-417013.html#incompatibilities.

Option 2 – Re-compiling and modifying source code.

Most of the new features introduced with Java SE 7 are improvements on a Java code level. To benefit from these you will have to update your old source code, or use the new features in any new code you write, and recompile your code for Java SE 7.

The Netbeans IDE can help you find locations in the code where you can use some of the new features, see this link for details. Other major IDEs have similar features.

Some APIs have been marked as deprecated, which means we encourage you to use the replacement APIs instead. The deprecated APIs can be found here.

Also, some of the APIs in the sun.* packages have changed. These APIs are, and have always been, intended for internal use only and any use is “at your own risk”. It is strongly recommended to find alternatives to using these packages as soon as possible.

Tuesday Sep 25, 2012

Oracle releases new Java Embedded products

With less than one week to go to JavaOne 2012, we've spiced things up a little by releasing not one but two net new embedded Java products. This is an important step towards realizing the vision of Java as the standard platform for the Internet of Things that I outlined in a recent blog post. The two new products are:

  • Java ME Embedded 3.2. Based on same code as the widely deployed Oracle Java Wireless Client for feature phones, this new product provides a Java ME implementation optimized for very small microcontroller-based devices and adds - among other things - a new Device Access API that enables interaction with peripherals common in edge devices such as various types of sensors. In addition to the new Java ME Embedded platform, we have also released an update of the Java ME SDK which adds support for the development of small embedded devices.
  • Java Embedded Suite 7.0. This is an integrated middleware stack for embedded devices, incorporating Java SE Embedded and versions of JavaDB, GlassFish and a Web Services stack optimized for remote operation and small footprint.

A typical Internet of Things (or M2M) infrastructure contains three types of compute nodes: The edge device which is typically a sensor or control point of some kind. These devices can be connected directly to a backend through a mobile network if they are installed in - for example - a remote vending machine; or, they can be part of a local short-range network and be connected to the backend through a more powerful gateway device. A gateway is the second type of compute node and acts as an aggregator and control point for a local network. A good example of this could be a generalized home Internet access point, or home gateway. Gateways are mostly using normal wall power and are used for multiple applications, deployed by multiple service providers. Finally, the last type of compute node is the normal enterprise or cloud backend. Java ME Embedded and Java Embedded Suite are perfect base software stacks for the edge devices and the gateway respectively, providing the Java promise of a platform independent runtime and a complete set of libraries as well as allowing a programmer to focus on the business logic rather than plumbing.

We are very thrilled with these new releases that open up exciting opportunities for Java developers to extend services and enterprise applications in ways that will make organizations more efficient and touch our daily lives. To find out more, come to the JavaOne conference (for technical content) and to the Java Embedded @ JavaOne subconference (for business content). There will be plenty of cool demos showing complete end-to-end applications, provided by Oracle and our partners, as well as keynotes and numerous sessions where you can learn more about the technology and business opportunities.

Thursday Aug 30, 2012

Oracle releases Java SE 7 Update 7, and Java SE 6 Update 35

This morning, Oracle released updates to JDK 6 and 7. For more information on these releases see:

Oracle recommends that users apply these updates as soon as possible. Users of Oracle JRE 6 and 7 for Windows (32-bit) and the recently released JRE 7 for Mac OSX (64-bit) will be updated automatically. For more information see, this blog entry.

Tuesday Dec 13, 2011

Java SE Embedded 7u2 Released

The Java SE Embedded team continues to follow the mainline JDK and has shipped their 7u2 and 6u30 releases. These releases include new ports to Linux on embedded PPC devices, and support for the server (C2) compiler on ARM. The latter improves Java performance on ARM systems by approximately 20-40%. You can find the downloads and release notes (7u2, 6u30) on the Oracle OTN web site.

Oracle's longer term strategy for Java on Embedded devices - as shared at JavaOne 2011 - is to converge the Java ME/CDC and Java SE Embedded platforms into one and use Project Jigsaw to produce a base module based on JDK 8 that requires no more than approximately 10 MB ROM. We also intend to port JavaFX to Linux on ARM for a coherent client story ranging from medium sized embedded devices to normal laptops and desktops.

Thursday Aug 11, 2011

Java 7 Questions & Answers

Updated 8/18 Please use a real email when commenting; some of your questions are not of general interest and will not be posted but I can often respond privately.

This blog entry will be used to host commonly asked questions related to Java 7. I have pre-seeded it with a few that have come up since the July 28 release. If you have additional questions, feel free to post as a comment to the blog. I will not respond to them in the comments, but will instead aggregate and update the blog entry. Only questions of general interest to the community will be answered here. Fire away!

Q: Where can I download Java 7?
A: From java.oracle.com, where you can find the JDK 7 download page.

Q: When will JRockit be available for Java 7?
A: It won't. As we explained last year we are merging JRockit and HotSpot into one single JVM. JDK 7 contains the first release of this converged JVM, where one of the first steps was to start removing the PermGen concept. Future JDK 7 updates will complete the PermGen removal, as well as add more visible features from JRockit.

Added 8/18
Q: I have created an application in Java 7, but when my users try to run it they get an Unsupported major.minor version 51.0 error. What does this mean and what can I do about it?
A: If you compile an application using javac in Java 7, the resulting classfiles will have the 51.0 version number. Versions of Java prior to 7 do not recogize this number, so your users will have to upgrade to Java 7 prior to running your application. If you are not using any Java 7 APIs you can try to compile your application using javac -target 1.6 to create a 1.6-compatible classfile. If your application is deployed using webstart you can specify the minimum version required. For more information, see the docs on Java Web Start and JNLP here. This issue will go away once we trigger autoupdate to Java 7 for end-users currently having Java 6 on their desktops. The timeline for this is not yet determined, we want to give developers time to work out any issues between their code and JDK 7 first.

Added 8/17
Q: Will the converged JVM get the feature that allows JRockit to allocate more heap on Windows?
A: For reference, the feature you are asking about is described here. Adding this to HotSpot turns out to be quite complex due to how the JVM is architected. Our current plans for convergence do not include this feature. We recommend using a 64-bit JVM instead, which does not run into this Windows limitation.

Q: Where can I find the source code?
A: The source code for the Java SE 7 Reference Implementation is available from the JDK 7 Project in the OpenJDK Community.

Added 8/17
Q: What is the difference between the source code found in the OpenJDK repository, and the code you use to build the Oracle JDK?
A: It is very close - our build process for Oracle JDK releases builds on OpenJDK 7 by adding just a couple of pieces, like the deployment code, which includes Oracle's implementation of the Java Plugin and Java WebStart, as well as some closed source third party components like a graphics rasterizer, some open source third party components, like Rhino, and a few bits and pieces here and there, like additional documentation or third party fonts. Moving forward, our intent is to open source all pieces of the Oracle JDK except those that we consider commercial features such as JRockit Mission Control (not yet available in Oracle JDK), and replace encumbered third party components with open source alternatives to achieve closer parity between the code bases.

Added 8/18
Q: How much more in JDK 7 is open source compared to JDK 6?
A: All new JDK 7 features are open source, as is the Java SE 7 Reference Implementation. Also, the majority of the features that are ported from JRockit are open source (or will be once they are in the JDK 7 code base).

Updated 8/17
Q: Why isn't Java 7 available on java.com yet?
A: The site java.com is used for end-user downloads. As with previous major versions of Java, JDK 7 is first made available to developers so that they can ensure that their Java programs work with the new JRE version before it gets rolled out to millions of end-users. There is a unobtrusive link from the website that takes you to developer downloads on java.oracle.com.

Q: Where can I find API documentation?
A: Javadocs are available here.

Q: What is the status of the port of Java 7 to the Mac?
A: Feature development is still going on in the OpenJDK Mac OS X Port 7 Project. You can see the detailed status here. Once that Project has made sufficient progress - say a couple of months from now or so - we plan to build and make a developer preview available from the main JDK download site. We will then work with Apple and others in the Mac OS X Port Project to finalize remaining feature work such as installers and plugin/webstart, and then go through the usual steps of one or more beta releases and/or release candidates before we get to GA. If you are anxious to get started, there are a number of third parties that provide binary builds from the OpenJDK code. Just use your favorite search engine and you'll find several.

Q: I have read about issues with Apache Lucene running on JDK 7, what is that about?
A: The Lucene project has reported that running Lucene triggers a JIT bug that causes a JVM crash. It can be worked around by disabling the broken optimizations with command line options, see the bug reports for details. The three bugs that Lucene reported have been fixed in the OpenJDK code, in addition to a fourth bug impacting Lucene that Oracle found (7070134, 7068051, 7044738, 7077439), and are included in current builds of JDK 7 Update 1 (and will remain included unless the fixes cause regressions). For more information on how Oracle prioritizes and works with external bug reports see this blog by Dalibor Topic. And while I'm at it - many thanks to all those of you who have tested JDK 7 and reported issues!

Q: I read the JDK 7 license. It mentions something about Commercial Features, what does that mean?
A: Sun versioned the end user license together with the binary, which made it clear what terms applied for a particular release. However, it also meant that a Java user would have to re-review the license for every new release (including update release), which lead to uncertainty around future licensing conditions. Oracle's approach is to minimize the number of licenses used for Java - ideally getting it down to only one. This means a more predictable and stable licensing situation, at the cost of a slightly more complex license text since it needs to be able to cover more scenarios. When we made JRockit free we modified the Binary Code License to make it cover all versions of Java, as well as JRockit. This was announced in one of my previous blog posts. The "Commercial Features" clause is there to allow us to port over value-add features from JRockit to the converged Hotspot/JRockit JVM starting with JDK 7. Full details on what features are non-free can be found in the product documentation. In the standard JDK 7 GA binaries, there are no commercial features so there is no risk that you use them by mistake. As we move such features to JDK 7 in a future update, our plan is to require an explicit flag to enable them. Note that these features are only restricted "for any commercial or production purpose" so individual developers need not worry. For full information, read the license text itself.

Thursday Jul 28, 2011

Java SE 7 is now GA

We are very happy to announce that JDK 7 is now GA. The release is on time according to the announcement we made at JavaOne last year and with no significant changes to release content. I would like to express a heartfelt thank you to all those at Oracle and elsewhere in the community that has helped with this release (honorable mentions).

With this important milestone behind us, our engineers are already busy with other projects such as JavaFX 2.0 and JDK 8. If you want to know more about JDK 7 or what's in the pipe, check out this podcast, the videos from the Java 7 launch and come and join us at JavaOne 2011!


Henrik Stahl is VP of Product Management in the Java Platform Group at Oracle, and is responsible for product strategy for Java ME and SE.


« April 2014