Interface Platform
- All Known Subinterfaces:
- org.graalvm.nativeimage.impl.InternalPlatform.NATIVE_ONLY, org.graalvm.nativeimage.impl.InternalPlatform.PLATFORM_JNI, org.graalvm.nativeimage.impl.InternalPlatform.WINDOWS_BASE, Platform.AARCH64, Platform.AMD64, Platform.ANDROID, Platform.DARWIN, Platform.DARWIN_AARCH64, Platform.DARWIN_AMD64, Platform.IOS, Platform.LINUX, Platform.LINUX_AARCH64_BASE, Platform.LINUX_AMD64_BASE, Platform.MACOS, Platform.RISCV64, Platform.WINDOWS
- All Known Implementing Classes:
- Platform.ANDROID_AARCH64, Platform.HOSTED_ONLY, Platform.IOS_AARCH64, Platform.IOS_AMD64, Platform.LINUX_AARCH64, Platform.LINUX_AMD64, Platform.LINUX_RISCV64, Platform.MACOS_AARCH64, Platform.MACOS_AMD64, Platform.WINDOWS_AARCH64, Platform.WINDOWS_AMD64
A platform group (e.g., an architecture or OS) is an interface extending Platform. A leaf
platform, e.g., a supported architecture-OS-combination, is a class that implements all the
groups that it belongs to. A leaf platform class must be non-abstract and must have a no-argument
constructor. It is good practice to make leaf platform classes final (to prevent
accidental subclassing) and to avoid state (i.e., no fields).
The annotation Platforms restricts a type, method, or field to certain platform groups or
leaf platforms.
This system makes the set of platform groups and leaf platforms extensible. Some standard platforms are defined as inner classes.
- Since:
- 19.0
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfaceSupported architecture: ARMv8 64-bit.static interfaceSupported architecture: x86 64-bit.static interfaceSupported operating system: Android.static final classSupported leaf platform: Android on AArch64 64-bit.static interfaceBasis for all Apple operating systems (MacOS and iOS).static interfaceBasis for all Apple operating systems on AMD64 (MACOS_AMD64 & IOS_AMD64).static interfaceBasis for all Apple operating systems on AMD64 (MACOS_AMD64 & IOS_AMD64).static final classMarker for elements (types, methods, or fields) that are only visible during native image generation and cannot be used at run time, regardless of the actual platform.static interfaceSupported operating system: iOS.static final classSupported leaf platform: iOS on AArch 64-bit.static final classSupported leaf platform: iOS on x86 64-bit.static interfaceSupported operating system: Linux.static final classSupported leaf platform: Linux on AArch64 64-bit.static interfaceBasis for all Linux operating systems on AARCH64 (LINUX_AARCH64 & ANDROID_AARCH64).static classSupported leaf platform: Linux on x86 64-bit.static interfaceBasis for all Linux operating systems on AMD64 (LINUX_AMD64).static final classSupported leaf platform: Linux on RISC-V 64-bit.static interfaceSupported operating system: MacOS.static final classSupported leaf platform: MacOS on AArch 64-bit.static final classSupported leaf platform: MacOS on x86 64-bit.static interfaceSupported architecture: RISC-V 64-bit.static interfaceSupported operating system: Windows.static final classSupported leaf platform: Windows on AArch 64-bit.static final classSupported leaf platform: Windows on x86 64-bit.
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptiondefault StringReturns the string representing Platform's architecture name.default StringgetOS()Returns the string representing Platform's OS name.static booleanincludedIn(Class<? extends Platform> platformGroup) Returns true if the current platform (the platform that the native image is built for) is included in the provided platform group.
- 
Field Details- 
PLATFORM_PROPERTY_NAMEThe system property name that specifies the fully qualified name of thePlatformimplementation class that should be used. If the property is not specified, the platform class is inferred from the standard architectures and operating systems specified in this file, i.e., in most cases it is not necessary to use this property.- Since:
- 19.0
- See Also:
 
 
- 
- 
Method Details- 
includedInReturns true if the current platform (the platform that the native image is built for) is included in the provided platform group.The platformGroup must be a compile-time constant, so that the call to this method can be replaced with the constant boolean result. - Since:
- 19.0
 
- 
getOSReturns the string representing Platform's OS name.This method should be implemented either in a final class or as default method in respective OS interface. - Since:
- 21.0
 
- 
getArchitectureReturns the string representing Platform's architecture name. This value should be the same as desired os.arch system property.This method should be implemented either in final class or as default method in respective architecture interface. - Since:
- 21.0
 
 
-