Ondrej Tokar Ondrej Tokar - 1 month ago 16
Java Question

Running Tomcat server with SSL certificate triggers could not find or load main class cert.pkcs12

I've been following this guide to setup SSL certificate on my Tomcat server.
https://docs.oracle.com/cd/E29585_01/PlatformServices.61x/security/src/tsec_ssl_jsp_pkcs12.html

When I try to run the .bat file with there mentioned parameters (with my pwd):

-Djavax.net.ssl.keyStoreType=PKCS12
-Djavax.net.ssl.keyStore=%CLIENT_CERT%
-Djavax.net.ssl.keyStorePassword=endeca
-Djavax.net.ssl.trustStore=%CLIENT_CERT%
-Djavax.net.ssl.trustStorePassword=endeca


I get this error at the startup:

Error: Could not find or load main class Files\Java\jre7\lib\security\cert.pkcs12


Any idea what am I doing wrong?

Answer

The issue is caused by the space in java installation path C:\Program Files\Java. Install java into a path without spaces will resolve the issue.

Update

Add quotes around the path solve also the issue. Thanks @Ondrej

Comments