Sdkman and installing Charles root certificates

If you use Sdkman to manage your Java versions, you will need to run the Charles root certificate install script for each Java version you use


Default Java version

Install Charles cert in default Java VM

  • To install the Charles root cert in your default JVM, go to Help -> SSL Proxying -> Install Charles Root Certificate in Java VMs
  • The Terminal will open. Follow the install instructions

Identify your default Java version

  • If you want to identify what you default Java version is, run the below command
    • java -version

Multiple Java versions

Sdkman and Charles

  • When you install the Charles root cert via the Help section, it will only be installed for 1 version of Java on your machine i.e. the default one
  • To get Charles to work with multiple Sdkman-managed-JVMs, you will need to run the Charles install script for each Java version

Change default Java version with Sdkman

  • To minimise issues, it’s best to use Sdkman to temporarily change the default Java version on your machine.
    • sdk default java <your-java-version>
  • Then go to Help -> SSL Proxying -> Install Charles Root Certificate in Java VMs and follow the install instructions
  • Repeat the above steps for each additional Java version

Leave a comment