public interface JavaRuntimeManager
Gradle just requires a suitable JRE to run on.
Most cases though Gradle build Java libraries/applications, and by default Gradle uses the JVM, that it is running on.
This manager separates the JavaRuntime on which Gradle can run from the JavaPlatform on which Gradle Java project can be built. Every JavaPlatform is a JavaRuntime, but not every JavaRuntime is a JavaPlatform way.
Modifier and Type | Interface and Description |
---|---|
static class |
JavaRuntimeManager.JavaRuntime
This class represents a java home directory with and id,
and an optional display name.
|
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_RUNTIME_ID
The ID that the Runtime shall use for the Java Runtime the IDE is runnoing on.
|
Modifier and Type | Method and Description |
---|---|
default void |
addChangeListener(ChangeListener l)
Register a change listener to this manager.
|
static JavaRuntimeManager.JavaRuntime |
createJavaRuntime(String id,
File javaHome) |
static JavaRuntimeManager.JavaRuntime |
createJavaRuntime(String id,
String displayName,
File javaHome) |
Map<String,JavaRuntimeManager.JavaRuntime> |
getAvailableRuntimes()
Return the available runtimes stored in the IDE with their respective Id-s.
|
default Optional<Runnable> |
manageRuntimesAction()
This method is called from the Gradle Execution Customizer when
the "Manage Runtimes..." button is called.
|
default void |
removeChangeListener(ChangeListener l)
Removes a change listener from this manager.
|
static final String DEFAULT_RUNTIME_ID
Map<String,JavaRuntimeManager.JavaRuntime> getAvailableRuntimes()
default Optional<Runnable> manageRuntimesAction()
default void addChangeListener(ChangeListener l)
The default implementation does nothing.
l
- the listener to be registered.default void removeChangeListener(ChangeListener l)
The default implementation does nothing.
l
- the listener to be removed.static JavaRuntimeManager.JavaRuntime createJavaRuntime(@NonNull String id, File javaHome)
static JavaRuntimeManager.JavaRuntime createJavaRuntime(@NonNull String id, String displayName, File javaHome)