Skip to content

About

Automatically synchronize company certificates to all JDK installations managed by SDKMAN!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

JDK Certificate Sync

Automatically synchronize company certificates to all JDK installations managed by SDKMAN!

Overview

This script eliminates the tedious manual process of re-importing company certificates every time you install a new JDK version. It creates symbolic links from your company's certificate store to each JDK installation, ensuring consistent certificate availability across all versions.

Prerequisites

  • JDK installations managed by SDKMAN!
  • Environment variable COMPANY_CACERTS set to your company's certificate file path in your shell configuration (.zshrc, .bashrc, or .bash_profile)

Example:

export COMPANY_CACERTS="/path/to/your/company/cacerts"

Installation

  1. Make the script executable:
chmod +x jdk-sync-certs.sh
  1. Run the script:
./jdk-sync-certs.sh

Verification

To verify the script worked correctly, check that the cacerts file is a symbolic link pointing to your company certificate store:

ls -l $(sdk home java 21.0.2-open)/lib/security/cacerts

Expected output:

lrwxr-xr-x  user  group  ... cacerts -> /path/to/your/company/cacerts

Automation

To run this script automatically every time you install a new JDK with SDKMAN!, add this alias to your shell configuration file:

# Automatically sync certificates after installing a new JDK
sdk-install() {
    sdk install "$@" && ~/jdk-sync-certs/jdk-sync-certs.sh
}

Now you can use sdk-install java 25-open instead of sdk install java 25-open, and certificates will sync automatically.

About

Automatically synchronize company certificates to all JDK installations managed by SDKMAN!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages