Supply installs the Zing JRE Note: Zing JRE does NOT install jvmkill or memory calculator components
()
| 42 | // Supply installs the Zing JRE |
| 43 | // Note: Zing JRE does NOT install jvmkill or memory calculator components |
| 44 | func (z *ZingJRE) Supply() error { |
| 45 | z.ctx.Log.BeginStep("Installing Zing JRE") |
| 46 | |
| 47 | // Determine version |
| 48 | dep, err := GetJREVersion(z.ctx, "zing") |
| 49 | if err != nil { |
| 50 | return fmt.Errorf("failed to determine Zing JRE version from manifest: %w", err) |
| 51 | } |
| 52 | |
| 53 | z.version = dep.Version |
| 54 | z.ctx.Log.Info("Installing Zing JRE (%s)", z.version) |
| 55 | |
| 56 | // Install JRE |
| 57 | if err := z.ctx.Installer.InstallDependency(dep, z.jreDir); err != nil { |
| 58 | return fmt.Errorf("failed to install Zing JRE: %w", err) |
| 59 | } |
| 60 | |
| 61 | // Find the actual JAVA_HOME (handle nested directories from tar extraction) |
| 62 | javaHome, err := z.findJavaHome() |
| 63 | if err != nil { |
| 64 | return fmt.Errorf("failed to find JAVA_HOME: %w", err) |
| 65 | } |
| 66 | z.javaHome = javaHome |
| 67 | z.installedVersion = z.version |
| 68 | |
| 69 | // Write profile.d script for runtime JAVA_HOME setup |
| 70 | if err := z.writeProfileDScript(); err != nil { |
| 71 | z.ctx.Log.Warning("Could not write java.sh profile.d script: %s", err.Error()) |
| 72 | } else { |
| 73 | z.ctx.Log.Debug("Created profile.d script: java.sh") |
| 74 | } |
| 75 | |
| 76 | z.ctx.Log.Info("Zing JRE installation complete") |
| 77 | return nil |
| 78 | } |
| 79 | |
| 80 | // Finalize performs final JRE configuration |
| 81 | // Adds -XX:+ExitOnOutOfMemoryError to JAVA_OPTS |
nothing calls this directly
no test coverage detected