public class JavaInstall
extends java.lang.Object
A JavaInstall can be extracted form a specific known Java installation using
the parse(Path).
One can extract all known installed Java installations off a given System using JavaLocator and the
associated Builder.
Concepts:
Installation Directory - A Java installation directory refers to the root directory of the java installation.
This directory usually has the java version within its name. However, is not guaranteed.
Java Home - Java home in this context is defined as the location in which the bin folder
containing Java executables can be found. On Linux and Windows, this is generally the same as the
Installation Directory, However on macOs this is usually the Contents/Home/ folder within
the Installation Directory.
Created by covers1624 on 30/10/21.
| Modifier and Type | Field and Description |
|---|---|
net.covers1624.quack.platform.Architecture |
architecture |
boolean |
hasCompiler |
java.lang.String |
implName |
java.lang.String |
implVersion |
boolean |
isOpenJ9 |
java.nio.file.Path |
javaHome |
JavaVersion |
langVersion |
java.lang.String |
runtimeName |
java.lang.String |
runtimeVersion |
java.lang.String |
vendor |
| Constructor and Description |
|---|
JavaInstall(java.nio.file.Path javaHome,
java.lang.String vendor,
java.lang.String implName,
java.lang.String implVersion,
java.lang.String runtimeName,
java.lang.String runtimeVersion,
net.covers1624.quack.platform.Architecture architecture) |
| Modifier and Type | Method and Description |
|---|---|
static java.nio.file.Path |
getBinDirectory(java.nio.file.Path installationDir)
Gets the bin directory for a given java installation.
|
static java.nio.file.Path |
getExecutable(java.nio.file.Path homeDir,
java.lang.String executable)
Gets the given executable within the given java home directory.
|
static java.nio.file.Path |
getHomeDirectory(java.nio.file.Path installationDir)
Gets the Java home directory from a specific Installation.
|
static java.nio.file.Path |
getJavaExecutable(java.nio.file.Path homeDir,
boolean useJavaw)
Gets the Java executable for a given home directory.
|
static @Nullable JavaInstall |
parse(java.nio.file.Path executable)
Execute the given Java executable, extracting information from it.
|
java.lang.String |
toString() |
public final JavaVersion langVersion
public final java.nio.file.Path javaHome
public final java.lang.String vendor
public final java.lang.String implName
public final java.lang.String implVersion
public final java.lang.String runtimeName
public final java.lang.String runtimeVersion
public final net.covers1624.quack.platform.Architecture architecture
public final boolean isOpenJ9
public final boolean hasCompiler
public JavaInstall(java.nio.file.Path javaHome,
java.lang.String vendor,
java.lang.String implName,
java.lang.String implVersion,
java.lang.String runtimeName,
java.lang.String runtimeVersion,
net.covers1624.quack.platform.Architecture architecture)
public static java.nio.file.Path getBinDirectory(java.nio.file.Path installationDir)
installationDir - The installation directory.public static java.nio.file.Path getHomeDirectory(java.nio.file.Path installationDir)
installationDir - The installation directory.public static java.nio.file.Path getJavaExecutable(java.nio.file.Path homeDir,
boolean useJavaw)
homeDir - The java home directory.useJavaw - If javaw should be used on Windows instead of java.Root javadoc contains definitions for homeDirpublic static java.nio.file.Path getExecutable(java.nio.file.Path homeDir,
java.lang.String executable)
homeDir - The home directory.executable - The executable name.@Nullable public static @Nullable JavaInstall parse(java.nio.file.Path executable)
executable - The executable to run.JavaInstall information.public java.lang.String toString()
toString in class java.lang.Object