11

I have a NetBeans project which is using the JRE 1.4 environment which means I can't use generics.

How can I change the project to use 1.6 (?) so I can use generics.

Cœur
  • 32,421
  • 21
  • 173
  • 232
griegs
  • 22,002
  • 28
  • 113
  • 201

3 Answers3

17
  • 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 Tools->Java Platform Manager.
  • If JDK 1.6 is not in the list you can add it there.
Haresh Chaudhary
  • 4,294
  • 1
  • 32
  • 56
OliBlogger
  • 1,321
  • 10
  • 25
1

In Netbeans 8.2,

  • right click the project, select Properties
  • under the menu build/compile, select java platform from drop down menu
Jovo Skorupan
  • 117
  • 1
  • 3
0

There is a bug in NetBeans 8.0.2

When undertaking the above steps in changing JRE or JDK for a project, NetBeans attempts to save the project with the new JDK (9 in this instance) but it goes into an infinite loop and eventually gives an OutOfMemoryError:

infinite loop while saving new project with new JDK

OutOfMemoryError

Mark Burleigh
  • 419
  • 3
  • 10