To read Excel file in Java, you need to create a Maven project and download the required JAR files manually.For reading Excel files, add the dependencies 'poi' and 'poi-ooxml' in your POM.xml file with the latest version.To read the contents of an Excel file, use the Apache POI library and handle Workbook, Sheet, Row, and Cell objects.To read a PDF file in Java, you need to download the Apache PDFBox dependency from the Maven Repository.