()
| 29 | ) |
| 30 | |
| 31 | func 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 | |
| 57 | func (m *mkcert) checkJava() bool { |
| 58 | if !hasKeytool { |
nothing calls this directly
no test coverage detected
searching dependent graphs…