<p>Thanks to <a href="https://stackoverflow.com/questions/6950960/how-can-i-set-the-jdk-netbeans-runs-on/6951067#6951067">Kasun Gajasinghe’s tip</a>, I found the solution in the “suggested” link. Update the following file (replace <strong>7.x</strong> with your NetBeans version):</p>
<p>`C:\Program Files\NetBeans 7.x\etc\netbeans.conf</p>
<pre><code class="lang-auto">
Change the following line to point it where your Java installation is:
`netbeans_jdkhome="C:\Program Files\Java\jdk1.7xxxxx"
</code></pre>
<p>You may need administrator privileges to edit <code>netbeans.conf</code>.</p>