public class SystemUtil extends SystemPropsUtil
Modifier and Type | Field and Description |
---|---|
static String |
CLASS_PATH
Java 类路径的KEY
|
static String |
CLASS_VERSION
Java 类格式版本号的KEY
|
static String |
COMPILER
要使用的 JIT 编译器的名称的KEY
|
static String |
EXT_DIRS
一个或多个扩展目录的路径的KEY
|
static String |
FILE_SEPARATOR
文件分隔符(在 UNIX 系统中是“/”)的KEY
|
static String |
HOME
Java 安装目录的KEY
|
static String |
LIBRARY_PATH
加载库时搜索的路径列表的KEY
|
static String |
LINE_SEPARATOR
行分隔符(在 UNIX 系统中是“\n”)的KEY
|
static String |
OS_ARCH
操作系统的架构的KEY
|
static String |
OS_NAME
操作系统的名称的KEY
|
static String |
OS_VERSION
操作系统的版本的KEY
|
static String |
PATH_SEPARATOR
路径分隔符(在 UNIX 系统中是“:”)的KEY
|
static String |
SPECIFICATION_NAME
Java 运行时环境规范名称的KEY
|
static String |
SPECIFICATION_VENDOR
Java 运行时环境规范供应商的KEY
|
static String |
SPECIFICATION_VERSION
Java 运行时环境规范版本的KEY
|
static String |
TMPDIR
默认的临时文件路径的KEY
|
static String |
USER_DIR
用户的当前工作目录的KEY
|
static String |
USER_HOME
用户的主目录的KEY
|
static String |
USER_NAME
用户的账户名称的KEY
|
static String |
VENDOR
Java 运行时环境供应商的KEY
|
static String |
VENDOR_URL
Java 供应商的 URL的KEY
|
static String |
VERSION
Java 运行时环境版本的KEY
|
static String |
VM_NAME
Java 虚拟机实现名称的KEY
|
static String |
VM_SPECIFICATION_NAME
Java 虚拟机规范名称的KEY
|
static String |
VM_SPECIFICATION_VENDOR
Java 虚拟机规范供应商的KEY
|
static String |
VM_SPECIFICATION_VERSION
Java 虚拟机规范版本的KEY
|
static String |
VM_VENDOR
Java 虚拟机实现供应商的KEY
|
static String |
VM_VERSION
Java 虚拟机实现版本的KEY
|
HUTOOL_DATE_LENIENT
Constructor and Description |
---|
SystemUtil() |
Modifier and Type | Method and Description |
---|---|
protected static void |
append(StringBuilder builder,
String caption,
Object value)
输出到
StringBuilder 。 |
static void |
dumpSystemInfo()
将系统信息输出到
System.out 中。 |
static void |
dumpSystemInfo(PrintWriter out)
将系统信息输出到指定
PrintWriter 中。 |
static ClassLoadingMXBean |
getClassLoadingMXBean()
返回Java虚拟机类加载系统相关属性
|
static CompilationMXBean |
getCompilationMXBean()
返回Java虚拟机编译系统相关属性
如果没有编译系统,则返回 null |
static long |
getCurrentPID()
获取当前进程 PID
|
static long |
getFreeMemory()
获取JVM中内存剩余大小
|
static List<GarbageCollectorMXBean> |
getGarbageCollectorMXBeans()
获取Java虚拟机中的
GarbageCollectorMXBean 列表 |
static HostInfo |
getHostInfo()
取得Host的信息。
|
static JavaInfo |
getJavaInfo()
取得Java Implementation的信息。
|
static JavaRuntimeInfo |
getJavaRuntimeInfo()
取得当前运行的JRE的信息。
|
static JavaSpecInfo |
getJavaSpecInfo()
取得Java Specification的信息。
|
static JvmInfo |
getJvmInfo()
取得Java Virtual Machine Implementation的信息。
|
static JvmSpecInfo |
getJvmSpecInfo()
取得Java Virtual Machine Specification的信息。
|
static long |
getMaxMemory()
获取JVM可用的内存总大小
|
static List<MemoryManagerMXBean> |
getMemoryManagerMXBeans()
获取Java虚拟机中的
MemoryManagerMXBean 列表The Java virtual machine can have one or more memory managers. |
static MemoryMXBean |
getMemoryMXBean()
返回Java虚拟机内存系统相关属性
|
static List<MemoryPoolMXBean> |
getMemoryPoolMXBeans()
获取Java虚拟机中的
MemoryPoolMXBean 列表The Java virtual machine can have one or more memory pools. |
static OperatingSystemMXBean |
getOperatingSystemMXBean()
返回Java虚拟机运行下的操作系统相关信息属性
|
static OsInfo |
getOsInfo()
取得OS的信息。
|
static RuntimeInfo |
getRuntimeInfo()
取得Runtime的信息。
|
static RuntimeMXBean |
getRuntimeMXBean()
返回Java虚拟机运行时系统相关属性
|
static ThreadMXBean |
getThreadMXBean()
返回Java虚拟机线程系统相关属性
|
static long |
getTotalMemory()
获取JVM中内存总大小
|
static int |
getTotalThreadCount()
获取总线程数
|
static UserInfo |
getUserInfo()
取得User的信息。
|
get, get, get, getBoolean, getInt, getLong, getProps, set
public static final String SPECIFICATION_NAME
public static final String VERSION
public static final String SPECIFICATION_VERSION
public static final String VENDOR
public static final String SPECIFICATION_VENDOR
public static final String VENDOR_URL
public static final String HOME
public static final String LIBRARY_PATH
public static final String TMPDIR
public static final String COMPILER
public static final String EXT_DIRS
public static final String VM_NAME
public static final String VM_SPECIFICATION_NAME
public static final String VM_VERSION
public static final String VM_SPECIFICATION_VERSION
public static final String VM_VENDOR
public static final String VM_SPECIFICATION_VENDOR
public static final String CLASS_VERSION
public static final String CLASS_PATH
public static final String OS_NAME
public static final String OS_ARCH
public static final String OS_VERSION
public static final String FILE_SEPARATOR
public static final String PATH_SEPARATOR
public static final String LINE_SEPARATOR
public static final String USER_NAME
public static final String USER_HOME
public static final String USER_DIR
public static long getCurrentPID()
public static ClassLoadingMXBean getClassLoadingMXBean()
ClassLoadingMXBean
public static MemoryMXBean getMemoryMXBean()
MemoryMXBean
public static ThreadMXBean getThreadMXBean()
ThreadMXBean
public static RuntimeMXBean getRuntimeMXBean()
RuntimeMXBean
public static CompilationMXBean getCompilationMXBean()
null
CompilationMXBean
,如果没有编译系统,则返回null
public static OperatingSystemMXBean getOperatingSystemMXBean()
OperatingSystemMXBean
public static List<MemoryPoolMXBean> getMemoryPoolMXBeans()
MemoryPoolMXBean
列表public static List<MemoryManagerMXBean> getMemoryManagerMXBeans()
MemoryManagerMXBean
列表public static List<GarbageCollectorMXBean> getGarbageCollectorMXBeans()
GarbageCollectorMXBean
列表GarbageCollectorMXBean
列表public static JvmSpecInfo getJvmSpecInfo()
JvmSpecInfo
对象public static JvmInfo getJvmInfo()
JvmInfo
对象public static JavaSpecInfo getJavaSpecInfo()
JavaSpecInfo
对象public static JavaRuntimeInfo getJavaRuntimeInfo()
JavaRuntimeInfo
对象public static OsInfo getOsInfo()
OsInfo
对象public static UserInfo getUserInfo()
UserInfo
对象public static RuntimeInfo getRuntimeInfo()
RuntimeInfo
对象public static long getTotalMemory()
public static long getFreeMemory()
public static long getMaxMemory()
public static int getTotalThreadCount()
public static void dumpSystemInfo()
System.out
中。public static void dumpSystemInfo(PrintWriter out)
PrintWriter
中。out
- PrintWriter
输出流protected static void append(StringBuilder builder, String caption, Object value)
StringBuilder
。builder
- StringBuilder
对象caption
- 标题value
- 值Copyright © 2024. All rights reserved.