Skip to content

XX. System (PlatformDetection)

carlosuc3m edited this page Sep 13, 2023 · 1 revision

Introduction

JDLL uses needs to be aware of the characteristics of the system it is running on in order to know which engines can it run and which ones it cannot. The class io.bioimage.modelrunner.system.PlatformDetection is used to identify the OS, Java version, chip architecture and in ARM64 systems, when Rosetta is being used. The methods in the class of interest help JDLL finding out if an engine is compatible or not with the system.

io.bioimage.modelrunner.system.PlatformDetection

General description

Class containing the methods needed to identify the features of the system and JVM JDLL is running on.

Static methods

String PlatformDetection.getOs()

Return the operating system where JDLL is running. The return values can be either windows, linux or macosx.

String PlatformDetection.getArch()

Return the chip architecture of the system. JDLL supports x86_64 and arm64.

boolean PlatformDetection.isUsingRosseta()

Returns whether JVM is running using Rosetta.

boolean PlatformDetection.isWindows()

Get whether the system JDLL is running on is Windows or not.

boolean PlatformDetection.isLinux()

Get whether the system JDLL is running on is Linux or not.

boolean PlatformDetection.isMacOS()

Get whether the system JDLL is running on is MacoOS or not.

boolean PlatformDetection.getJavaVersion()

Get the Java version of the JVM JDLL is running on