How to parse String to LocalDate in Java 8 - DateTimeFormatter Example

From Java 8 onward, you are no longer dependent on the buggy and bulky SimpleDateFormat class to parse and format date Strings into real Date object in Java e.g. java.util.Date. You can use the DateTimeFormatter class from java.time package for all your formatting and parsing need. You are also no longer required to use another buggy class java.util.Date if you are doing fresh development, but if you have to support legacy code then you can also easily convert LocalDate and LocalTime to java.util.Date or java.sql.Date. In this tutorial, we will learn about both parsing String to date in Java and formatting Date into String.

How to Set Specific Java Version for Maven in Windows?

Maven is a great build tool and most of the Java developer uses Maven to build their projects, but like any other tool, there are some intricacies which you need to know while using it. One of them is that Maven uses Java version from the JAVA_HOME environment variable and not the PATH environment variable. If you have multiple JDK installed on your machine and getting an Unsupported major.minor version 51.0 or Unsupported major.minor version 52.0 error while building your project but have right Java version in PATH then you may need to check the JAVA_HOME and update it. If you don't have access to do it then you can still change JAVA_HOME using set command in your local shell and run the Maven's mvn command to build the project