 <p>I was getting a similar error when the file used to create the output stream already had data. If you are looking to <strong>append</strong> data to the file, you must indicate so in the file output stream object:</p> <pre><code>FileOutputStream out = new FileOutputStream("/Users/muratcanpinar/Downloads/KNVBJ/build/classes/knvbj/ClubInformation.xlsx", true); </code></pre> <p>When you do this, <code>wb.write(out)</code> should work as expected.</p>