Keytool: Import Certificate – Java Certs

If you use a self-signed SSL certificate or a certificate that has been issued by unknown CA (certificate authority), Java client will raise an exception:

SunCertPathBuilderException: unable to find valid certification path to requested target

To resolve this issue the self-signed certificate or the CA certificate should be imported into Java keystore using a keytool command.

In this note i will show how to import a certificate into Java keystore using the keytool command in a non-interactive way.

I will also show an example of how to import a CA certificate into Java keystore cacerts. (more…)

Java Version: Get Current JDK/JRE Version – Command

Sometimes it is required to check the current version of Java installed.

By Java version i mean the version of Java Development Kit (JDK) or the version of Java Runtime Environment (JRE).

As JDK and JRE are different components of Java (JDK is used to compile Java programs while JRE is used to run them), there are different commands to check their versions.

This short note explains how to find out the current version of Java (JDK/JRE) from the command line. (more…)

Install Maven in Windows

Apache Maven is a command-line tool for building and managing dependencies of Java-based applications.

Maven requires Java and before installing Maven in Windows it needs to ensure that Java Development Kit (JDK) is installed and JAVA_HOME environment variable is set.

As only this requirement is satisfied, you can download and install Maven.

In this note i will show how to install Maven in Windows, set the MAVEN_HOME environment variable and add Maven to PATH. (more…)