Change JRE in a NetBeans project

Solution 1:

  • In the Project tab, right-click on the project and select Properties. In the Library category select Java Platform JDK 1.6.
  • Then, in the Source category select Source/Binary Format JDK6.
  • This assumes that you installed JDK 1.6 and NetBeans knows about this.
  • JDK 1.6 must be known to NetBeans as a Java Platform.
  • From the menu select menu ToolsJava Platform Manager.
  • If JDK 1.6 is not in the list, you can add it there.

Solution 2:

In NetBeans 8.2,

  • right click the project, and select Properties
  • under the menu build/compile, select the Java platform from the drop down menu