且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Netbeans - 构建目标JDK 6但使用Java 7 JRE运行

更新时间:2023-01-14 23:07:25

转到通过右键单击左侧窗格来显示项目属性

Go to the project properties by right clicking on the left hand pane

构建 - >编译

在较低的一侧你会看到其他编译器选项

on lower side you will see Additional Compiler options

将参数设为 -target 6 ,这将根据 JDK 6 编译代码,当你运行程序时,它将使用 JRE 7 $ c运行它$ c>。

give the params as -target 6 and this will compile you code according to JDK 6 and when you will run the program it will run it using JRE 7.