Two key points from the user query:
- Already installed JDK7;and
- Using Netbeans
So, netbeans came with two package:
- With JDK
Means when install the Netbeans 7 it automatically install JDK 7 and set JDK 7 as Default Library.
- Without JDK
On the installation of NetBeans 7, it found JDK in the system, and if found it automatically configure the path of library as well, but show you information about the path and version of JDK7.
All of users try to give the correct answer of this query, but no one is in position to answer in the correct way as the user required because user using the Netbeans as well.
With continue the edit version of Hemal Pandya, one thing more is required to configure, which is that
RightClick on Project > properties > and in the categories option select > source. see the
**Hemal Pandya** edit version to look at image, the source option is available above the
Libraries option.
And
then select **Source/Binary Format** form bottom and set it to JDK 7 (= 1.7). this is the exact solution
of user's post and I am 100% sure now String in swich will work
-source 7flag.