Tagged: Java

4 ways to delete folder recursively in Java

If you try to delete a not empty folder, a java.nio.file.DirectoryNotEmptyException will be thrown. This tutorial will show 4 differents ways to delete folder recursively in Java : Native Java WalkFileTree Apache Commons IO SpringUtils...

More

No main manifest attribute, in jar

Problem Sometimes you face the following error while runing an executable jar : No main manifest attribute, in “<APP_NAME>.jar” Solution Main-class property is missing on your jars META-INF/MANIFEST.MF. Correct it by adding the following...

More

Write properties file in Java

Properties file are often used in Java applications in the aim to store configuration parameters, internationalization and various informations. Each line of a properties file is a key/value entry. The key and the value...

More

Read properties file in Java

Properties file are often used in Java applications in the aim to store configuration parameters, internationalization and various informations. A properties file have « .properties »  as extension where each line is a key/value...

More

How to write file in Java

In this post, you will lean how to write file in Java. 4 various ways will be used : BufferedWriter PrintWriter Using Try with resources Using fileUtils from Apache commons IO 1- BufferedWriter Since...

More

How to read file in Java

In this tutorial, we will learn how to read file in Java. 4 easy ways will be used : BufferedReader Scanner Using try with resources Using fileUtils from Apache commons IO

More