How to import a jar in Eclipse

You can add a jar in Eclipse by right-clicking on the Project → Build Path → Configure Build Path. Under Libraries tab, click Add Jars or Add External JARs and give the Jar. A quick demo here. The above solution is obviously a “Quick” one. However, if you are working on a project where you need … Read more

Deleting an object in java?

You should remove the references to it by assigning null or leaving the block where it was declared. After that, it will be automatically deleted by the garbage collector (not immediately, but eventually). Example 1: Example 2: Not something that you are currently looking for, but FYI: you can invoke the garbage collector with the … Read more

How to resolve Unable to load authentication plugin ‘caching_sha2_password’ issue

Starting with MySQL 8.0.4, they have changed the default authentication plugin for MySQL server from mysql_native_password to caching_sha2_password. You can run the below command to resolve the issue. sample username / password => student / pass123 Refer the official page for details: MySQL Reference Manual

when to throw FileNotFoundException

Java has some controversy about its exceptions. It has two classes of exceptions. Checked and unchecked. Any exception extending from RuntimeException or Error is unchecked and does not need to be caught or explicitly declared as throwable in a method signature. FileNotFound is however a checked exception and must either be caught or declared as … Read more

Tomcat 404 error: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists

Problem solved, I’ve not added the index.html. Which is point out in the web.xml Note: a project may have more than one web.xml file. if there are another web.xml in src/main/webapp/WEB-INF Then you might need to add another index (this time index.jsp) to src/main/webapp/WEB-INF/pages/