What does the arrow operator, ‘->’, do in Java?

That’s part of the syntax of the new lambda expressions, to be introduced in Java 8. There are a couple of online tutorials to get the hang of it, here’s a link to one. Basically, the -> separates the parameters (left-side) from the implementation (right side). The general syntax for using lambda expressions is (Parameters) … Read more

Adding external library to artifact jar in IntelliJ IDEA

You have 2 options here: extract the dependency into the artifact jar so that the app is the single executable jar with all the dependencies link the dependent jars via the Manifest.MF and copy them near the application main jar I’ve prepared a sample project that demonstrates both approaches: HelloWithDependencies.zip. The artifacts are produced into … Read more

Can’t compile project when I’m using Lombok under IntelliJ IDEA

I have fixed it in IDEA 12 by setting check box Enable annotation processing in: Settings -> Compiler -> Annotation Processors For IDEA 2016.2: Preferences… > Build, Execution, Deployment > Compiler > Annotation Processors After enabling, run Build -> Rebuild Project to have annotations recognized and eliminate errors. For IDEA 2019.2.1, depending on how the … Read more

How to clear gradle cache?

Gradle cache is located at On Windows: %USERPROFILE%\.gradle\caches On Mac / UNIX: ~/.gradle/caches/ You can browse to these directory and manually delete it or run rm -r $HOME/.gradle/caches/ on UNIX system. Run this command will also force to download dependencies. UPDATE Clear the Android build cache of current project NOTE: Android Studio’s File > Invalidate … Read more

Tomcat 10.0.4 doesn’t load servlets (@WebServlet classes) with 404 error [duplicate]

For copyright reasons the Servlet 5.0 API (implemented by Tomcat 10) and the Servlet 4.0 API (implemented by Tomcat 9) are incompatible: the API namespace changed from javax.* to jakarta.*. This can manifest in many ways: Software written for Servlet 4.0 does not compile against the API jars from Tomcat 10: cf. Servlet 5.0 JAR … Read more