I am facing a strange issue. My code runs just fine from Netbeans or cmd with
java -jar MP2.jar
but when I try to run it from the .bat or .cmd
"%JAVA_HOME%"\bin\java -jar .. \dist\MP2.jar > test_mp2_out.txt
I get an error in my text file
DataIn\nrmavg.txt (The System cannot find the path specified)
or a null pointer exception at the line I have new FileReader(nrmavg.txt)
I can provide more code if needed, but I think this may be a windows problem.
Any ideas?
I think FileReader(“nrmavg.txt”) won’t be looking for a file inside .jar, just a current directory. Could you try using something like this instead?