Java 7: new coffee
Last week, I wrote an article for our corporate weblog on the development of Java 7. Since the article was in Dutch, I didn’t post it on my personal blog. But I wanted to post some follow ups, and since it is not very easy to do this on the weblog of Finalist, I decided to translate the article to English and post it here. The translation is done pretty quickly, and thus very likely a bit rough on the edges. I think it is also interesting for non-Dutch readers.
While Java is already in the game for several years, development on new features and improvements for the language are still going on to ensure that Java will be useful in the future. Java 6 has been released more than two years ago, and is slowly becoming old caffee. Most people prefer freshly cooked caffee, and therefore a large number of developers are working on Java 7. The planned release for this newly brewed Java is stated for March 2010. In this article, I will try to provide an overview on the current state of Java 7 and what we can expect in the final release.
Big changes
While it is far from sure which will eventually be part of Java 7, some big changes are defined of which it will be very likely that it will be part of the new release. The most important change is modularization of the JDK. This project, which is currently knonw by the name ‘Project Jigsaw’, aims to provide a more flexible platform and make it easier to distribute Java libraries and applications. In a nutshell, the idea is to extend the Java language with syntax to load modules and define to which module a particular Java class, interface or package belongs. A module is a top level grouping of Java packages on a language level and jar files on a file system level. Java modules can be loaded dynamically – comparable to the way in which OSGi works – and it is possible to define dependencies within modules. Such a dependency can be optional, but it is also possible to prevent other modules to depend upon a given module. A new accessibily level will be added for classes and interfaces which makes it possible to restrict access to a certain class or interface from within the current module. As for now, the keyword which is proposed for this feature is ‘module’, but it will remain possible to call classes and other elements module (so, it will not become a reserved keyword).
The biggest advantages of the modularization will be the reduced amount of dependency problems within libraries, which is currently a major issue in larger Java applications. Project Jigsaw will make it possible to use multiple versions of the same module in a single application. Another advantages is that the JDK will be modularized as well, which makes it possible to reduce the core JDK significantly. Parts of the JDK which are not required for a certain application don’t have to be installed on the system, increasing the speed and reducing the size of the used JDK. Parts of Java which are not used anymore can be depricated more easily (because there are simply not installed anymore) and it will also be easier to add new parts to the JDK.
The modularization of the Java language is a very invasive operation. It requires changes to the syntax of the language, to the core libraries and the Java compiler. Sun Microsystems took the burden upon itself to implement this change, but also stated that it won’t be possible to make other large changes to the language. Victims of this decision are closures and the support for property fields.
Av few other changes which will be very likely to find their way into the JDK 7 is the NIO2 library. NIO2 uses operating system specific code to access files, directories and network resources, which leads to several speed improvements as well as extended capabilities which were not possible without NIO2. One of the notable improvements offered by NIO2 is the possibility of asynchronous access of (metadata) of files, enabling for example to execute code when a file is change without having to poll the file regularly for changes. There will also be changes to the concurrency framework, improvements in the other standard Java libraries and updates to the Swing framework, including the Swing Application framework and a multimedia component which makes it easier to implement video playing capabilities into Java applications.
JVM changes
Another big improvement, which will certainly be part of Java 7, is the so-called ‘invoke dynamic’ feature for the JVM. This is not a change to the Java programming language, but will only be cause changes in the virtual machine. Invoke dynamic will benefit the dynamic languages which are available for the JVM, including JRuby, Jython, Scala, Clojure, Groovy, JavaFX and Fan. A complete explanating of this feature would require a article in itself (apart from the fact I can’t really explain it completely and corretly at this moment). It will make it possible to execute individual methods which don’t necessarily belong to a particular object or class. This is especially relevant for languages which support closures or provide possibilities to add methods to an object after it has been instanciated.
The current development version of the JVM (under the OpenJDK umbrella) already contains a new garbage collector (called Garbage First) which will improve performance in comparison to the current garbage collector (which uses a concurrent mark sweep algorithm), but the most important improvement is that the GC time will be more predictable.
Project Coin
There is a lot to write on the new features which are considered for Java 7 inclusion. However, space is limited here, so I have to wrap it up. There is one item which I will discuss here, and that is Project Coin. Despite the fact that there will not be many large changes to the Java programming language with the Java 7 release, the developers would not want to skip the opportunity to do small languages changes with this new major release. These small language changes are selected using strict criteria: a language change should be relatively easiliy to implement and should give a significant productivity improvement for a Java programmer. An example of such a feature from the past is the ‘foreach’ construction added with Java 5.
Everyone who has a good idea for a small language improvement can submit his proposal to the Project Coin mailinglist. The proposal should be done using a standard proposal form and has to be submitted before the 30th of March 2009. At the moment of this writing, there were 21 proposal submitted. A few of them are seriously considered for implementation (eventually, about five proposals will be part of Java 7):
- The possibility to use Strings in a switch statement.
- Improved type inference for Generics, making it possible to write for example the following:
Map<String , List<String>> myMap = new HashMap<>();.
It would not be required anymore to repeat the types on the right side statement, which reduces the amount of typing by the programmer. - The ‘elvis’ operator and other operators which will make testing for null on variables unnecessairy. Example:
MyObject myInstance = getMyInstance(); MyInstance.?toString();
In the current Java, the myInstance.toString() call should be preceded by a checn on null for myInstance in order to avoid a possible NullPointerException. - Improved exception handling, including the possibility to handle multiple exceptions within one catch block and safe rethrow of exceptions.
There are more interesting (and not-so-interesting) proposals, and there will definitaly be more new proposals submitted before the deadline will pass, but the list above will give a rough indication of which we can expect in Java 7. For developers who are interested in language development and in which way Java will evolve with the next release, it is certainly worthwhile to check out the Project Coin mailinglist. There are very intersting discussions on the proposed features and the huge implications which can come with (apparently) small changes.
Conclusion
Since it will take at least another year before Java 7 is released, at this moment the rough shape of this upcoming release is slowly revealed. Of course things will change over the next year and the described features are far from there eventual specification, it is safe to conclude that Java 7 will bring nice improvements. Not only for Java developers, but also for developers using alternative languages for the JVM.
The biggest difference compared to previous Java releases is the fact that all development is done in the open. Most of it will be part of the OpenJDK project, and otherwise as part of the Java 7 project. The OpenJDK development release, which already contains some improvements for Java 7, can be downloaded and installed at this very moment. So check it out if you want to try the new features!
I will try to give updates on this blog when there is something interesting to tell on the Java 7 development.
Tags: development, java, Java 7, JDK
This entry was posted on Wednesday, March 25th, 2009 at 23:55 and is filed under English, Software, java. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.






March 28th, 2009 at 12:21
Wolkje.net Weblog » Blog Archive » JDK 7: new developments says:[...] Wolkje.net Weblog Writing student and technology fan « Java 7: new coffee [...]
April 2nd, 2009 at 22:26
It’s not Elvis operator (Elvis stands for ?: short ternary).
April 21st, 2009 at 6:31
Interview Questions - RBS | Tech BhaiGiri says:[...] http://www.wolkje.net/index.php/2009/03/25/java-7-new-coffee/ [...]
March 27th, 2010 at 22:17
Great success quotes
April 24th, 2010 at 22:42
What should i say? I am truly fascinated with the quality of your writing skills
June 5th, 2010 at 22:38
I enjoyed reading this article! Thank you so much for sharing it!
June 15th, 2010 at 17:34
Thank you for such a nice blog. It was what I looked for.
June 30th, 2010 at 11:47
This is the coolest website and stories that i have ever read…its useful for me as im a lecturer and always motivate my students with these publised stories…thank you …and waiting for plenty more…
July 16th, 2010 at 15:19
Great text and nice blog.
August 4th, 2010 at 4:22
Has anyone here ever played Evony? I suggest checking it out for anyone who wants to try something different, it’s free and will keep you entertained for quite awhile. I found a link that gives you some extra start up gold when you sign up which helps greatly for noobies so go through that if you want to try it out. Hope you guys enjoy it.
August 24th, 2010 at 13:06
I like this blog. I’ll definitely be peeping into it again.
August 24th, 2010 at 13:41
I really was enjoy reading your blog, great stuff. I’m happy that I went just here.
August 24th, 2010 at 13:48
I love this blog. I will for sure be peeping into it frequently.
September 1st, 2010 at 14:24
Long time reader, 1st time commenting.
September 3rd, 2010 at 3:45
Especially illuminating publish, love the way you generate and then i think that the tips helps in the way. I do not normally say this, however I believe it’s a very good job done. In the event you happen to like to trade links, I would be extra than pleased to supply a hyperlink back to your website. Hope to listen to from you shortly. Cheers
September 21st, 2010 at 16:38
Took me moment to examine every one of of the commentary, except I really loved the piece of writing. It proved being in reality helpful to me with I am constructive to every single one the commenters here! It’s in the main kind when you can not just be informed, but in addition entertained! I am constructive you had pleasing writing this write-up.
October 24th, 2010 at 12:18
Canon 300d user how-to book. I only subscribed to a frequented Canon 300D, as well as it didn’t come via a intstruction bok. Is There anywhere I could could download this? Or maybe are a web site using tips?
October 27th, 2010 at 13:57
Took me time to explore every single one of the commentary, other than I in fact enjoyed the piece of writing. It proved being in fact ready to lend a hand to me with I am constructive to every one the commenters here! It’s in the main pleasant whenever you be able to not just be informed, but in adding entertained! I am positive you had enjoyable writing this write-up.
November 6th, 2010 at 14:02
It gave me some suggestions and I’ll be placing them on my site soon.
November 10th, 2010 at 19:36
Judaism has always been a strong interest of mine. My two sons speak Hebrew and are familiar with the scriptures and with rabbinic literature. This is the way we live.
November 24th, 2010 at 7:33
I love coming back to your personal blog. I found on it when I was looking in bing for info.
December 3rd, 2010 at 8:28
Sorry for the review, but I’m fond the new Zune, and comic this, as recovered as the reviews both different people soul graphic, instrument work you resolve if it’s the alter for you.
December 3rd, 2010 at 11:57
Jordan Linda
January 8th, 2011 at 8:03
thanks for this nice tips
January 8th, 2011 at 9:11
A fair death honors the whole life.
January 31st, 2011 at 21:51
Even though quite a number of people have mentioned, still I must say thanks for sharing.
February 13th, 2011 at 16:17
Hm, So i’m ok with this but still not utterly sure, hence i’m about to research a little bit more.
February 24th, 2011 at 4:52
Would you be concerned about exchanging hyperlinks?
May 17th, 2011 at 0:30
The next time I learn a blog, I hope that it doesnt disappoint me as much as this one. I imply, I do know it was my option to read, but I actually thought youd have something fascinating to say. All I hear is a bunch of whining about something that you could possibly repair in case you werent too busy searching for attention.
May 20th, 2011 at 17:33
Thanks for your valuable post. In recent times, I have come to understand that the symptoms of mesothelioma cancer are caused by the particular build up associated fluid between your lining of the lung and the breasts cavity. The disease may start inside the chest area and propagate to other body parts. Other symptoms of pleural mesothelioma cancer include weight loss, severe inhaling trouble, temperature, difficulty ingesting, and irritation of the neck and face areas. It ought to be noted some people living with the disease do not experience almost any serious indications at all.
May 26th, 2011 at 21:59
Hey thanks for this share, much appreciated!
June 14th, 2011 at 10:32
Amazing content!
Thank you for this share!
[url=http://www.tlsubmit.com/]seo[/url]
July 27th, 2011 at 2:27
A sort of excellent stuff regarding this issue! One and all can choose writing service to buy custom essay papers, further more I get custom essays.
August 1st, 2011 at 19:27
Hi
What do you thing about below diet supplement? I’m going to buy something good for muscle growth. Please give me a piece of advice.
[url=http://www.universal-nutrition.pl/universal-storm.html]Storm[/url]
August 2nd, 2011 at 16:26
54. Hi, Neat post. There is a problem with your site in internet explorer, would check this… IE still is the market leader and a big portion of people will miss your magnificent writing due to this problem.
August 8th, 2011 at 23:53
This is getting a bit more subjective, but I much prefer the Zune Marketplace. The interface is colorful, has further flair, and a number of cool features comparable ‘Mixview’ that let you quickly see related albums, songs, or other people related to what you’re listening to. Clicking on one of those will center on that item, along with another set of « neighbors » will come into view, allowing you to navigate around exploring by similar artists, songs, or users. Speaking of viewers, the Zune « Social » is as well grand fun, letting you find others with shared tastes plus becoming friends with them. You then know how to listen to a playlist created based on an amalgamation of what all your friends are listening to, which is additionally enjoyable. Those concerned with privacy will be relieved to recognize you be able stop the public from seeing your personal listening habits if you so choose.
August 8th, 2011 at 23:55
After researching a number of of the blog posts in your web site now, and I really like your means of blogging. I bookmarked it to my bookmark website listing and shall be checking again soon. Pls take a look at my website as nicely and let me know what you think.
August 26th, 2011 at 16:16
Really Appreciate this post, can you make it so I get an alert email when there is a new article?
August 31st, 2011 at 16:32
My spouse and i extremely liked studying your upload. Thanks a lot!A part of take a look at closefisted to help my personal neural kind regards, think your Really simply syndication nutrition ?
September 6th, 2011 at 11:25
I’m not certain the things I could possibly have gone through without the entire aspects provided by you about such a question.
September 10th, 2011 at 21:12
I will be always searching online for ideas that will help me. Thanks!
September 22nd, 2011 at 10:45
This is the an awesome blog. I recommend it to anyone who needs to find out about this topic.
December 14th, 2011 at 17:39
Nice commentary. last thirty times I uncovered this online internet internet site and desired to permit you be conscious that i’ve been gratified, heading by way of your site’s posts. I should undoubtedly be signing just as as a whole lot since the RSS feed and may wait around for yet another post. Cheers, Glen
December 14th, 2011 at 17:40
It is tough to discover educated males and females on this topic, however you seem like you realize anything you could be talking about! Thanks
December 14th, 2011 at 18:28
Lately, I didn’t give lots of consideration to leaving feedback on blog page posts and have placed comments even much less.
http://realbooster.com/seo-services/free-proxy-list-tool/
December 15th, 2011 at 8:06
I like Your Article about Martin @ Blog » Blog Archive » Java 7: new coffee Perfect just what I was looking for! .
January 4th, 2012 at 21:29
I’ve been checking out a couple of of your stories and i ought to say nice stuff. I will surely bookmark your website
January 5th, 2012 at 1:16
I found this post via a friend on Twitter – love it! I’ll be visiting again