Recommended solutions based on your search
When you iterate over the lines of a scala.io.Source with source.getLines, make sure you do not close the source until you processed the iterator.
This occurs when the file is being locked by another application. Check if another process is accessing the same file. On Windows follow this post to figure it out : https://goo.gl/yPp1To
If it's being used, terminate that process to gain access.
Solutions on the web
java.io.IOException: The handle is invalid
at java.io.FileInputStream.readBytes(Native Method)