I have no idea of how Netbeans IDE run a java file.
Firstly, it would ensure the .class file is up-to-date.
Then, execute the class. But from where (working directory) and with which command (parameter)?
I observe difference on how relative path is located when I run the java file from Netbeans IDE and when I run using Windows command prompt (i.e > java pack.age.name.ClassName
)