First verify that the user running your P4Java application has the privileges to access the file. Typically this means the user should be the owner of the file as the user must have the privileges to alter the file's read/write permission.
If the accessing user owns the file, using Java 1.5 is a likely root cause of this problem.
Using Java 1.5 requires additional programming steps. See "Using P4Java with Java 1.5" for information on using Java 1.5 with P4Java.
If you encounter these errors when using P4Ant or P4Maven, see "Using Java 1.5 with P4Maven and P4Ant" for the changes needed.
ILogCallback Method Invocation
If you have implemented an ILogCallback class, information about this Java 1.5 deficiency will present itself with calls to your ILogCallback class's internalError(), internalException(), and internalWarn() methods at startup:
internalError: No such method for helper class: java.io.File.setWritable(boolean)
internalWarn: No such method for helper class: java.io.File.canExecute()
internalError: No such method for helper class: java.io.File.setReadable(boolean, boolean)
internalException: java.io.File.setReadable(boolean, boolean)