My java project build in jdk 7 . I want to convert it into jdk 6. How can I do this? It is possible that convert it? in netbeans.
2 Answers
Add separate JDK (1.6) to your IDE preferences. In build path of project change used JRE Environment from 1.7 to just added 1.6.
UPD:
For NetBeans click Tools > Java Platforms > Add Platform
where you specify additional JRE.
Then go to your Project view > Right Click on libraries > Properties
and select just added java platform.

- 10,719
- 2
- 33
- 55
-
I installed jdk 1,6 but I cant find where I change it in preferences? I use netbeans. – CompEng Aug 11 '12 at 13:28
You can configure your NetBeans project source code and binary output to be Java 6, see this answer:
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.
Note, you don't have to since JDK 7 is backward compatible.
Alternatively, if it is a Maven based project, you can configure the maven-compiler-plugin to use version 1.6:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>