java

package
v0.0.0-...-1cc5353 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package java provides Java installation management for MineWorker.

Package java provides Java installation management for MineWorker.

Package java provides Java installation management for MineWorker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPlatformInfo

func GetPlatformInfo() (os string, arch string)

GetPlatformInfo returns the current platform information for downloads.

func JavaVersionToString

func JavaVersionToString(version int) string

JavaVersionToString converts a Java version number to a human-readable string.

Types

type AdoptiumRelease

type AdoptiumRelease struct {
	Binary struct {
		Package struct {
			Checksum string `json:"checksum"`
			Link     string `json:"link"`
			Name     string `json:"name"`
			Size     int64  `json:"size"`
		} `json:"package"`
		ImageType    string `json:"image_type"`
		Architecture string `json:"architecture"`
		OS           string `json:"os"`
	} `json:"binary"`
	ReleaseName string `json:"release_name"`
	VersionData struct {
		Major int `json:"major"`
	} `json:"version"`
}

AdoptiumRelease represents a release from the Adoptium API.

type Installation

type Installation struct {
	Version    int
	Vendor     string
	Path       string // Absolute path to java binary
	InstallDir string // Directory containing the installation
}

Installation represents an installed Java runtime.

type Installer

type Installer struct {
	// contains filtered or unexported fields
}

Installer handles downloading and installing Java runtimes.

func NewInstaller

func NewInstaller(paths *utils.Paths) *Installer

NewInstaller creates a new Java installer.

func (*Installer) Install

func (i *Installer) Install(ctx context.Context, version int, vendor string, progress func(msg string)) error

Install downloads and installs a Java runtime.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles Java installation resolution and management.

func NewManager

func NewManager(paths *utils.Paths) *Manager

NewManager creates a new Java manager.

func (*Manager) ListInstalled

func (m *Manager) ListInstalled() ([]Installation, error)

ListInstalled returns all installed Java runtimes.

func (*Manager) Resolve

func (m *Manager) Resolve(ctx context.Context, req Requirement, progress func(msg string)) (*Installation, error)

Resolve finds or installs a Java runtime that satisfies the requirement. It returns the absolute path to the java binary.

type Requirement

type Requirement struct {
	MinVersion int    // Minimum Java version required (e.g., 8, 17, 21)
	MaxVersion int    // Maximum supported Java version (0 = no maximum)
	Vendor     string // Preferred vendor (e.g., "temurin", "graalvm")
}

Requirement specifies Java version requirements.

func ResolveForMCVersion

func ResolveForMCVersion(mcVersion string) Requirement

ResolveForMCVersion returns the Java requirement for a given Minecraft version. This maps Minecraft versions to their required Java versions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL