diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index ae9ac1a904..cbab7aa014 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -137,6 +137,13 @@ public class Util { LOGGER.log(Level.INFO,"Failed to chmod "+f,e); } + // also try JDK6-way of doing it. + try { + f.setWritable(true); + } catch (NoSuchMethodError e) { + // not JDK6 + } + if(!f.delete() && f.exists()) throw new IOException("Unable to delete " + f.getPath()); }