In order to connect a Java application to Dynamics 365, you will need to have Java JDK installed to compile your application, Azure ADAL and its dependencies to connect to Azure, and a JSON parsing library such as org.json.jar to parse the JSON responses. Optionally, you can use Maven to resolve your dependencies by creating a pom.xml file or even use an IDE, such as Eclipse, to improve your productivity.