

This is preferable to using third-party libraries. In the blog post Differences between source level 1.5 and 1.6 in NetBeans, Antonio Santiago wrote in early 2008 that NetBeans made use of Java SE 6's new Swing-related classes when JDK 1.6 was set as the release.
#Jdk for netbeans software
However, it turns out that there still are some differences and it's probably best to have 1.6 specified if that's the JDK the software is being written against. It's easy to think that there is no use in setting the source release in NetBeans to 1.6 (6) because Java SE 6 did not introduce any new language features.
#Jdk for netbeans code
In that post, I demonstrated how NetBeans 7 (and even some older versions of NetBeans) can help flag areas of code where J2SE 5 and Java SE 7 new features apply and are not being used. I specifically discussed this approach using NetBeans 7 to "modernize" Java code bases to newer releases of Java in the blog post Seven NetBeans Hints for Modernizing Java Code.

An opposite benefit of this can be achieved by moving NetBeans's project's release to the new SDK release when appropriate because it can help developers identify ways in which they can improve their code base with the new version. The last example showed how using an "older" release can lead to errors regarding language features that did not exist for that release. An example of this is shown in the next screen snapshot, which depicts the NetBeans error message when an enum is specified in a NetBeans project in which the JDK release is specified as 1.4. For example, if the source JDK release is not set to at least 1.5 (or 5), then standard language constructs such as annotations, enums, and generics are shown are compilation errors in NetBeans. Some benefits of setting the source level appropriately in NetBeans are obvious.

NetBeans 7.1 lists even more versions, ranging from JDK 1.2 through JDK 7. According to the JDK 7 javac compiler documentation, it respects the following releases: 1.3, 1.4, 1.5 (5), 1.6 (6), and 1.7 (7). There are several benefits to setting this JDK/Java version source level appropriately. This is shown in the next screen snapshot. Setting a project like that shown in the above screen snapshot leads to the setting of the properties javac.source and javac.target in the nbprojects/project.properties file. This is shown in the next screen snapshot with a really old version (1.2) of the SDK displayed. In a standard ("Java Application") NetBeans project, the JDK version is for the project is specified in the Project -> Properties -> Sources window. In this post, I look at some of the numerous benefits of appropriately setting the Java release source level in NetBeans. NetBeans uses its projects' settings for javac.source (and javac.target in more ways than simply enforcing javac's use of the -source and -target.
