Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

errors when using bat file to launch .jar

 
Jeremy James Brown
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing a strange issue. My code runs just fine from Netbeans or cmd with



but when I try to run it from the .bat



I get just error in my text file



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?
 
Stephan van Hulst
Bartender
Pie
Posts: 5893
63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a guess, but the file you're trying to read is probably in some folder relative to your working directory, and the working directory is different when you run the code from your batch file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic