public abstract class Platform extends Object
限定符和类型 | 类和说明 |
---|---|
static class |
Platform.CPU
The supported CPU architectures.
|
static class |
Platform.OS
The common names of supported operating systems.
|
限定符和类型 | 字段和说明 |
---|---|
protected Pattern |
libPattern |
构造器和说明 |
---|
Platform(Platform.OS os,
Platform.CPU cpu,
int addressSize,
int longSize,
String libPattern) |
限定符和类型 | 方法和说明 |
---|---|
int |
addressSize()
已过时。
Use
Runtime.addressSize() instead. |
Platform.CPU |
getCPU()
Gets the current processor architecture the JVM is running on.
|
String |
getName()
Gets the name of this
Platform . |
static Platform |
getNativePlatform()
Gets the native
Platform |
Platform.OS |
getOS()
Gets the current Operating System.
|
static Platform |
getPlatform()
已过时。
|
String |
getStandardCLibraryName()
Returns the platform specific standard C library name
|
boolean |
isBSD() |
boolean |
isUnix() |
List<String> |
libraryLocations(String libName,
List<String> additionalPaths)
Returns a list of absolute paths to the found locations of a library with the base name
libName ,
if the returned list is empty then the library could not be found and will fail to be loaded as a result. |
String |
locateLibrary(String libName,
List<String> libraryPath)
Searches through a list of directories for a native library.
|
int |
longSize()
已过时。
Use
Runtime.longSize() instead. |
String |
mapLibraryName(String libName)
Maps from a generic library name (e.g.
|
protected final Pattern libPattern
public Platform(Platform.OS os, Platform.CPU cpu, int addressSize, int longSize, String libPattern)
public static Platform getNativePlatform()
Platform
@Deprecated public static Platform getPlatform()
public final Platform.OS getOS()
OS
value representing the current Operating System.public final Platform.CPU getCPU()
CPU
value representing the current processor architecture.public final boolean isBSD()
public final boolean isUnix()
public final int longSize()
Runtime.longSize()
instead.public final int addressSize()
Runtime.addressSize()
instead.public String getName()
Platform
.public String getStandardCLibraryName()
public String mapLibraryName(String libName)
libName
- The library name to mappublic String locateLibrary(String libName, List<String> libraryPath)
libName
- the base name (e.g. "c") of the library to locatelibraryPath
- the list of directories to searchpublic List<String> libraryLocations(String libName, List<String> additionalPaths)
libName
,
if the returned list is empty then the library could not be found and will fail to be loaded as a result.
Even if a library is found, this does not guarantee that it will successfully be loaded, it only guarantees
that the reason for the failure was not that it was not found.libName
- the base name (e.g. "c") of the library to locateadditionalPaths
- additional paths to search, these take precedence over default paths,
(as is the behavior in LibraryLoader
)
pass null to only search in the default pathsCopyright © 2021. All rights reserved.