Download and Install Java SE (Download JDK)
Win+Pause -> Advanced system settings -> Environment Variables
Edit Path and add after string: ;C:\Program Files\Java\jdk1.6.0_24\bin\
This works then:
javac Example.java
java Example
Edit
e.g. netbeans_jdkhome="C:\Program Files\Java\jdk1.6.0_24\"