Search code examples
netbeansjavajava-5

Why does NetBeans still use JDK 1.5?


This question has always bothered me. And the NetBeans wiki does not say anything about that... Besides, JDK 1.5 will complete the End of Life process very soon and 1.6 has been around for quite a while.

So why do they still use version 1.5 even if 1.6 is available on all Netbeans-supported platforms?


Solution

  • The NetBeans team requires JDK 1.5 to ensure that the resulting jars will run on a 1.5 JVM.

    You don't need to build it with JDK 1.5 if it's just for your own use. But if you're planning on developing modules, you'll need to use 1.5 to ensure everyone else can use your modules.

    If you compile with 1.6, you can use the -target 1.5 to generate classes that will load into a 1.5 JVM. The downside is it will not prevent you from using classes or methods introduced in 1.6 (eg: StringBuilder). It will load in a 1.5 JVM, but will fail with the likes of ClassNotFoundException, NoSuchMethodErrot, or NoSuchFieldError.