Skip to main content

New Articles: NIO-2 in JDK 7 and Maven in NetBeans 6.7.1

Posted by editor on October 15, 2009 at 5:30 AM PDT

Yesterday we published two new java.net articles: Sweeping the File System with NIO-2, by Manish K. Maheshwari (his first java.net article), and Working with Maven in NetBeans 6.7.1, by John Ferguson Smart. We also published a new Java Mobile podcast, Java Mobile Podcast 89: David "Left" Schlesinger on Open Source.

Sweeping the File System with NIO-2

Manish's article provides a comprehensive introduction to JSR 203: More New I/O APIs for the Java Platform. Manish starts out by stating the problem:

A good number of Java applications work closely with the file system. The historic file system management capabilities in the JDK are limited, and therefore even commonly performed file interactions can require a lot of custom coding on top of the provided API. For example, let's say that you need to poll files for changes. You'd have to write that yourself. Even some of the provided features have deficiencies: the rename and move operations are not guaranteed to be atomic. In the event of failure, the original file and the target file may both exist or the target file may be incompletely written to the disk. The applications that want to handle these scenarios are forced to resort to native code and thus lose the platform-independence benefits of Java.

These are some pretty serious deficiencies, particularly as even desktop computing advances into the multithreaded realm due to the advent of multicore processors. To be sure, the integration of NIO-2 into JDK 7 is viewed by many developers as among the most critical of the JDK 7 enhancements.

Manish outlines the various facets of NIO-2, including discussion of the new, informative exceptions, class orchestration, the file notification and watch service API, the provider interface, interoperability, and tree walking.

Before Manish sent the article to me, it was reviewed by Alan Bateman, the specification lead for JSR-203, and the implementation lead for NIO-2 in the OpenJDK project. So, if you're looking for an authoritative overview of NIO-2, that you can consume in one sitting, do check out Manish's article, Sweeping the File System with NIO-2

Working with Maven in NetBeans 6.7.1

John Ferguson Smart, who published his first java.net article in early 2006, is a freelance consultant who specializes in enterprise Java, web development, and open source technologies. If you're a regular visitor to the java.net home page, you'll have seen his blog posts regularly highlighted there.

Among John's current interests are open source tools that contribute increased efficiency to the software development process. His new article Working with Maven in NetBeans 6.7.1 goes over the considerable enhancements that are built into NetBeans 6.7.1 for integration with Apache Maven projects.

While John notes that the integration of Maven in m2eclipse remains more mature than what's available in NetBeans, he sees the enhancements in NetBeans 6.7.1 as being a major leap in capability for Maven users. Indeed, the NetBeans approach to Maven seems to offer some advantages with respect to design and seamless integration:

Eclipse has traditionally had rich, though sometimes brittle, Maven support in the form of the m2eclipse plugin. NetBeans Maven support, on the other hand, is a more recent innovation, but that has been getting better and better with each release.

Working with Maven in NetBeans 6.7.1 covers:

  • Creating a Maven project in NetBeans
  • Working with your Maven project
  • Managing the Pom file
  • Managing Dependencies

John's conclusion begins:

The bottom line is, if you are a NetBeans fan, the latest NetBeans release comes packed with features that can make it easier to work with Maven projects. The integration is seamless, and the interface well designed and ergonomic.

And he ends his article with "it's great to see the quality of Maven IDE support growing strongly in at least two of the three major Java IDEs."


In Java Today, Cay Horstmann posted his report on Oracle OpenWorld Day 1:

I got a blogger pass for Oracle OpenWorld. Here is my report from the show floor. Yesterday, I wrote that Oracle OpenWorld seemed a bit bigger than Java One. Today when I saw the crowds during daytime I realized how naive I was. This is a HUGE conference, filling the main Moscone building, Moscone West, and two hotels. Talks range from "Virtualize your enterprise and cut costs with Oracle VM" to "Win Big with Government Contracts and PeopleSoft ESA". The bookstore didn't carry Core Java but instead featured books on Sarbanes-Oxley and self-motivation, in addition to the usual Oracle DBA fare. There were a few talks on Java, JDBC programming, JSF, ADF Faces, and the BEA app server...

Also reporting from OOW, Arun Gupta posted Oracle Open World 2009 - Day 2 Report:

Following from Day 1, the Day 2 started with Charles Phillips and Safra Catz keynote. The keynotes at Open World are significantly different from JavaOne or any other developer conference I've attended so far. Of course they are expected to be because Open World is not primarily a developer's conference. Oracle Develop (OD) certainly closely mimic any of the conferences I've typically attended. My "exhibitor" badge restricted me from attending any of the sessions at OD though. Here are some interesting statistics about the conference ...

Java Champion Bert Ertman is also at the conference, and posted his Impressions from Oracle OpenWorld: "Is Oracle good for Java?":

Here's a little write-up of my Oracle OpenWorld impressions so far. I'll try to make it a complete, logical story, but first I would like to second some excellent observations made by fellow Java Champion Cay Horstmann (yeah, the hero that wrote 'Core Java'), who blogs about his first day of OpenWorld at java.net.

The big question for me is: "Is Java safe in the hands of Oracle"? Unfortunately, I cannot answer that question based upon my impressions so far, but I can say that the message (or lack of) that Oracle is sending out so far is giving me some shivers down the spine. Here’s why:

Oracle is positioning Sun as the hardware company that they are: especially interested in it's Sparc servers, storage, and of course the new Exadata flash hardware database machine. The latter being undoubtedly very awesome. In other areas of the new portfolio Sun's software is being positioned, especially MySQL and Solaris. However, when it comes to Java, the official statement being made by Sun's Scott McNeally and Oracle's Larry Ellison is: "Java speaks for itself". But does it? ...


In today's Weblogs, Sahoo investigates Having trouble creating a Jar with MANIFEST.MF?:

When my colleague Marina Vatkina sent me some code earlier today hoping a second pair of eyes would spot the obvious error, knowing how thorough Marina typically is, I knew there was no obvious error there. Simplified version of what was being attempted is shown below...

John Ferguson Smart talks about test-driven development in For a fistful of dollars: quantifying the benefits of TDD:

According to a recent scientific study, using TDD increases development (coding) time by 15-30%, but results in 40-90% fewer defects. This study was done with 4 different development teams, from IBM (1 team) and Microsoft (3 teams), whose development practices are nothing if not pragmatic. This actually confirms what any TDD practitioner will tell you: you spend a bit more time writing tests up front, but the quality of the resulting code is largely superior...

Rex Young continues his series with Thread-Safe Swing Application (Part 3):

In order to handle user input to Swing components, you need to implement event listeners and make them listen to Swing components. Your listener will be invoked when the Swing component fires an event. This is from front-end to back-end. On the other hand, from back-end to front-end, it is still true if you do not employ some other work flow frameworks. For example, your back-end receives some data from remote server, and fires events. Listeners in the different layers of code will update data models, cache, Swing models, and eventually update the Swing component. This way the screen is able to show new data to user...


In the Forums, jellevictoor has a problem with XWSS not applied on outgoing message: "I'm working on a project that uses Metro. I have a webserviceclient pointing to a wsdl that has no security policy defined. But the message must be signed. I've made a security-config.xml ..."

stichel has questions about Java user management: "Hello, I am just wondering if there is any experience with a ready-to-use user management system for Java such as jum/Talos, JFacets, OSUser, jGuard, ... I need a facility to manage users with their credentials, user-groups,..."

And mikelwagan is seeing a JDIC: Error ...libmawt.so with link time reference: "Been trying to use JDIC, but I get the following error just using a sample program. At first I was using the 20061102 version. I encountered this error and tried using the older versions but still the same error occurs. I also tried both to Suse and Red..."


Our current Spotlight is the JavaFXpert RIA Exemplar Challenge. The java.net JUGs Community reports: Java Champion Jim Weaver has a serious JavaFX contest going on. "Create an application in JavaFX that exemplifies the appearance and behavior of a next-generation enterprise RIA (rich internet application)". Entries must be submitted in the form of a NetBeans project by 00:00 GMT on 10 January 2010.


The current java.net Poll asks What future do you foresee for GlassFish? Today (Thursday) is the last full day for the poll.


Our Feature Articles include Manish K. Maheshwari's Sweeping the File System with NIO-2, which describes how JSR 203 (NIO-2), which is being implemented in the OpenJDK project, is shaping the future of I/O in the upcoming JDK 7. We're also featuring John Ferguson Smart's article Working with Maven in NetBeans 6.7.1, which shows why, if you are a NetBeans user working with Maven, you're in luck with NetBeans 6.7.1.


The latest Java Mobility Podcast is Java Mobile Podcast 89: David "Left" Schlesinger on Open Source: David "Left" Schlesinger, Director of Open Source Technologies at Access, shares his views on open source with Terrence Barr.


Current and upcoming Java Events:

Registered users can submit event listings for the java.net Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.


Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of java.net it will be archived along with other past issues in the java.net Archive.

-- Kevin Farnham

O'Reilly Media

Related Topics >>