Top Description Fields Constructors Methods
org.graalvm.home.impl

public final Class DefaultHomeFinder

extends HomeFinder
Class Inheritance
Imports
java.io.BufferedInputStream, .IOException, .InputStream, java.nio.file.DirectoryStream, .Files, .NoSuchFileException, .Path, .Paths, .StandardOpenOption, java.util.Collections, .HashMap, .Map, .Map.Entry, .Properties, .Set, org.graalvm.home.HomeFinder, org.graalvm.nativeimage.ImageInfo, .ProcessProperties

This is a private implementation class. It is only public for ServiceLoader to work.

Field Summary

Modifier and TypeField and Description
pack-priv static final Path
pack-priv static final Path
private static final String
private static final String
private volatile Object
private static final Object
pack-priv static final Map<String, Path>
private volatile Map<String, Path>
private static Set<String>
nativeImageLanguages

Languages included in the native image.

private static Set<String>
nativeImageTools

Tools included in the native image.

private static final boolean
private volatile Map<String, Path>
private volatile Boolean
private volatile String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static Map<String, Path>
private Map<String, Path>
private static Path
private static Path
private static String
private static Path
private static Path

Returns:

the path to GraalVM home or null
getGraalVmHomeLibPolyglotFallBack
(Path
the path to libpolyglot
objectFile
)

Fallback for the GraalVM home using location of libpolyglot in jdk layout.

private Path
public Path
public Map<String, Path>
public Map<String, Path>
public String
private static boolean
private static boolean
private boolean
private Path
private static void
setNativeImageLanguages(Set<String> languages)

Sets languages included in a native image.

private static void
setNativeImageTools(Set<String> tools)

Sets tools included in a native image.

private static boolean
private static Path
private static Path
trimAbsolutePath(Path absolute, Path expectedRelative)

private void
verbose(Object... args)

Inherited from org.graalvm.home.HomeFinder:
getInstance

Field Detail

FORCE_GRAAL_HOMEback to summary
pack-priv static final Path FORCE_GRAAL_HOME
GRAAL_HOME_RELATIVE_PATHback to summary
pack-priv static final Path GRAAL_HOME_RELATIVE_PATH
GRAALVM_VERSIONback to summary
private static final String GRAALVM_VERSION
GRAALVM_VERSION_PROPERTYback to summary
private static final String GRAALVM_VERSION_PROPERTY
graalVMHomeback to summary
private volatile Object graalVMHome
HOME_NOT_FOUNDback to summary
private static final Object HOME_NOT_FOUND
LANGUAGE_RELATIVE_HOMESback to summary
pack-priv static final Map<String, Path> LANGUAGE_RELATIVE_HOMES
languageHomesback to summary
private volatile Map<String, Path> languageHomes
nativeImageLanguagesback to summary
private static Set<String> nativeImageLanguages

Languages included in the native image. The variable is set at the native image build time. When the languages are known, there is no need to list directories at image execution time to find the language homes.

nativeImageToolsback to summary
private static Set<String> nativeImageTools

Tools included in the native image. The variable is set at the native image build time. When the tools are known, there is no need to list directories at image execution time to find the tool homes.

STATIC_VERBOSEback to summary
private static final boolean STATIC_VERBOSE
toolHomesback to summary
private volatile Map<String, Path> toolHomes
verboseback to summary
private volatile Boolean verbose
versionback to summary
private volatile String version

Constructor Detail

DefaultHomeFinderback to summary
public DefaultHomeFinder()

Method Detail

collectHomesback to summary
private static Map<String, Path> collectHomes(Path folder)
collectStandaloneHomesback to summary
private Map<String, Path> collectStandaloneHomes()
getCurrentExecutablePathback to summary
private static Path getCurrentExecutablePath()
getCurrentObjectFilePathback to summary
private static Path getCurrentObjectFilePath()
getFileNameback to summary
private static String getFileName(Path path)
getGraalVmHomeFromRelativeLauncherPathback to summary
private static Path getGraalVmHomeFromRelativeLauncherPath(Path executableOrObjFile)
getGraalVmHomeLibPolyglotFallBackback to summary
private static Path getGraalVmHomeLibPolyglotFallBack(Path objectFile)

Fallback for the GraalVM home using location of libpolyglot in jdk layout.

Parameters
objectFile:Path

the path to libpolyglot

Returns:Path

the path to GraalVM home or null

getGraalVmHomeNativeback to summary
private Path getGraalVmHomeNative()
getHomeFolderback to summary
public Path getHomeFolder()

Implements abstract org.graalvm.home.HomeFinder.getHomeFolder.

Returns:Path

Doc from org.graalvm.home.HomeFinder.getHomeFolder.

the GraalVM home folder if inside GraalVM or null otherwise.

Annotations
@Override
getLanguageHomesback to summary
public Map<String, Path> getLanguageHomes()

Implements abstract org.graalvm.home.HomeFinder.getLanguageHomes.

Returns:Map<String, Path>

Doc from org.graalvm.home.HomeFinder.getLanguageHomes.

a Map of language ids to their home path.

Annotations
@Override
getToolHomesback to summary
public Map<String, Path> getToolHomes()

Implements abstract org.graalvm.home.HomeFinder.getToolHomes.

Returns:Map<String, Path>

Doc from org.graalvm.home.HomeFinder.getToolHomes.

a Map of tool ids to their home path.

Annotations
@Override
getVersionback to summary
public String getVersion()

Implements abstract org.graalvm.home.HomeFinder.getVersion.

Returns:String

Doc from org.graalvm.home.HomeFinder.getVersion.

the GraalVM version or "snapshot" if unknown.

Annotations
@Override
isJdkHomeback to summary
private static boolean isJdkHome(Path path)
isJreHomeback to summary
private static boolean isJreHome(Path path)
isVerboseback to summary
private boolean isVerbose()
searchHomeFolderback to summary
private Path searchHomeFolder()
setNativeImageLanguagesback to summary
private static void setNativeImageLanguages(Set<String> languages)

Sets languages included in a native image.

Note

this method is called reflectively by TruffleBaseFeature

Annotations
@SuppressWarnings:unused
setNativeImageToolsback to summary
private static void setNativeImageTools(Set<String> tools)

Sets tools included in a native image.

Note

this method is called reflectively by TruffleBaseFeature

Annotations
@SuppressWarnings:unused
setRelativeLanguageHomeIfNotAlreadySetback to summary
private static boolean setRelativeLanguageHomeIfNotAlreadySet(String languageId, Path homePath)
Annotations
@SuppressWarnings:unused
toRealPathback to summary
private static Path toRealPath(Path p)
trimAbsolutePathback to summary
private static Path trimAbsolutePath(Path absolute, Path expectedRelative)
verboseback to summary
private void verbose(Object... args)