Fixing No Compiler is Provided in this Environment Error for Maven Project with Eclipse

When you try to run a Maven project Java Servlet app first time, you might get this No Compiler is Provided error

Eclipse/Maven error: “No compiler is provided in this environment”

The solution is simple. You need to add tools.jar to installed JRE.

(1) Eclipse –> Window –> Preference
(2) Search with Installed JREs
(3) Select the version of JRE you are using and click Edit
(4) Select Standard VM and click Next
(5) Add External JARs
(6) Select tools.jar from the java/JDKx.x/lib folder
(7) Click Finish

This should fix the error.

Front-End
TypeScript: type aliases to check type equality

This post is to analyse how the type equality check by using type aliases proposed by Matt Pocock in his twitter post. These type aliases allow us to elegantly express type equality checks in unit tests. All we need to do is to pass the output and expected types in …

Front-End
Fixing it.only type error in Jest

If you are getting a type error with it.only in Jest, it could be due to incorrect TypeScript typings or incompatible versions of Jest and TypeScript. To resolve this issue, you can try the following steps: Make sure you have the latest versions of Jest and its TypeScript typings installed …

Front-End
yup conditional validation example

Here’s an example of a Yup validation logic where the first input field is optional but, if filled, it must contain only alphabetic characters, and the second input field is required: import * as Yup from “yup”; const validationSchema = Yup.object().shape({ firstField: Yup.string().matches(/^[A-Za-z]*$/, { message: “First field must contain only …