Skip to the content.

Chocolatey Package for Java Version Manager (jvm-windows)

This directory contains the Chocolatey packaging manifests, build scripts, and verification automation for Java Version Manager for Windows (DiamTek JVM).


Package Structure

packages/choco/
├── jvm.nuspec                     # Chocolatey/NuGet package specification
├── build-choco.ps1                # Automated packaging, checksum binding & validation script
├── README.md                      # This documentation
└── tools/
    ├── chocolateyInstall.ps1      # Package installation script
    └── chocolateyUninstall.ps1    # Package uninstallation script

Components

1. jvm.nuspec

The package specification conforming to the NuGet / Chocolatey v2 schema.

2. tools/chocolateyInstall.ps1

Handles seamless, secure installation of DiamTek JVM on target systems:

3. tools/chocolateyUninstall.ps1

Provides clean, deterministic uninstallation:

4. build-choco.ps1

Automation script to build and validate the Chocolatey .nupkg package:


Build & Test Workflow

Prerequisites

Building the Package

To build the .nupkg package locally:

# From the repository root
powershell.exe -ExecutionPolicy Bypass -File .\packages\choco\build-choco.ps1

# Or specify a custom version
powershell.exe -ExecutionPolicy Bypass -File .\packages\choco\build-choco.ps1 -Version 1.0.2

Testing Local Installation

To test installing the locally compiled package:

choco install jvm-windows --source .\packages\choco -y

Verifying Installation

jvm version
jvm doctor

Testing Uninstallation

choco uninstall jvm-windows -y

Security Hardening Matrix

CWE Class Description Mitigation Strategy
CWE-20 Improper Input Validation Strict SemVer regex validation (^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$) rejecting traversal characters (..).
CWE-59 Improper Link Resolution Pre-execution reparse point check (Test-HasReparsePointInLineage) before executing uninstall.ps1.
CWE-354 Hash Verification Mandatory 64-hex SHA-256 integrity verification before execution.
CWE-426 Untrusted Search Path System directory pinning ([Environment+SpecialFolder]::System) for core binaries.
CWE-459 Incomplete Cleanup Deterministic cleanup of .nupkg.tmp staging artifacts in finally blocks.
CWE-611 XML External Entity (XXE) Strict prohibition of DTD processing and external XML entity resolution during manifest validation.
CWE-918 Server-Side Request Forgery Strict host allowlist verification on download endpoints.

← Back to Main Repository Documentation  •  📦 Installation Guide