It seeems that the java binary does not have execution permission. Executing chmod a+x /usr/bin/java/jre-8u171-i586/bin/java might solve the issue.
But there is something wrong with how you installed java. I would try to install it using the package manager.
Answer from Gonzalo Matheu on Stack OverflowPermission Denied After Trying To Open .jar File
linux - How to modify the permission of jar file exactly same as other machine jar file? - Unix & Linux Stack Exchange
How to open the jar from cmd without getting access is ...
java - Adding jar file to buildpath and got permission denied error - Stack Overflow
Like the message says, you probably don't have permissions to read that file. To troubleshoot, you can add:
System.out.println(sourceFile.getAbsolutePath());
to find the exact location of the file that you're trying to read and then checking the file system permissions for it:
ls -la <path to your file>
Verify that you have the r permission, otherwise this is the error that you get.
One way to do this is to navigate to the file and change the permission to allow every user to read the file. The easiest is via terminal:
chmod +r /path/to/file
To see all the different uses follow the link and learn about chmod. https://codex.wordpress.org/Changing_File_Permissions