MCPcopy
hub / github.com/FiloSottile/mkcert / init

Function init

truststore_java.go:31–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29)
30
31func init() {
32 if runtime.GOOS == "windows" {
33 keytoolPath = filepath.Join("bin", "keytool.exe")
34 } else {
35 keytoolPath = filepath.Join("bin", "keytool")
36 }
37
38 if v := os.Getenv("JAVA_HOME"); v != "" {
39 hasJava = true
40 javaHome = v
41
42 if pathExists(filepath.Join(v, keytoolPath)) {
43 hasKeytool = true
44 keytoolPath = filepath.Join(v, keytoolPath)
45 }
46
47 if pathExists(filepath.Join(v, "lib", "security", "cacerts")) {
48 cacertsPath = filepath.Join(v, "lib", "security", "cacerts")
49 }
50
51 if pathExists(filepath.Join(v, "jre", "lib", "security", "cacerts")) {
52 cacertsPath = filepath.Join(v, "jre", "lib", "security", "cacerts")
53 }
54 }
55}
56
57func (m *mkcert) checkJava() bool {
58 if !hasKeytool {

Callers

nothing calls this directly

Calls 1

pathExistsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…