The /
at the start will make the path absolute instead of relative.
Try removing the leading /
, so replace:
InputStream is = new FileInputStream("/files/somefile.txt");
with:
InputStream is = new FileInputStream("files/somefile.txt");
If you're still having trouble, try making sure the program is running from where you think by checking the current directory:
System.out.println(System.getProperty("user.dir"));