"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../../_virtual/_rolldown/runtime.js');
let node_path = require("node:path");
node_path = require_runtime.__toESM(node_path);
let node_process = require("node:process");
node_process = require_runtime.__toESM(node_process);

//#region src/external-tools/jre/from-java-home.ts
/**
* @file `jreFromJavaHome()` — checks `$JAVA_HOME` for an existing JRE/JDK.
*   Returns the resolved-shape object if the env var is set; otherwise
*   `undefined`. Does NOT verify that the path actually contains a working
*   `bin/java` — that's the caller's job (or the spawn will fail loudly at the
*   use site). Keeping this leaf cheap means socket-cli can call it
*   unconditionally without paying a stat per resolution.
*/
function jreFromJavaHome() {
	const javaHomeEnv = node_process.default.env["JAVA_HOME"];
	if (!javaHomeEnv) return;
	return {
		javaPath: node_path.default.join(javaHomeEnv, "bin", node_process.default.platform === "win32" ? "java.exe" : "java"),
		javaHome: javaHomeEnv,
		source: "java-home"
	};
}

//#endregion
exports.jreFromJavaHome = jreFromJavaHome;