Class SystemUtil
java.lang.Object
com.sure.tool.util.SystemUtil
系统属性工具类,参考 Hutool 的
SystemUtil 设计。
English: Runtime and operating-system information helpers.
- Since:
- 0.1.0
- Author:
- suretool
-
Method Summary
Modifier and TypeMethodDescriptionstatic String获取系统属性。static String获取系统属性,不存在返回默认值。static String文件分隔符(Windows 为\,Linux 为/)。static longJVM 空闲内存(字节)。static StringJava 安装目录。static StringJava 版本,如"17.0.3"。static String行分隔符。static longJVM 最大可用内存(字节)。static String操作系统架构,如"amd64"。static String操作系统名称,如"Windows 11"。static String操作系统版本。static String路径分隔符。static longJVM 总内存(字节)。static int获取当前 JVM 活动线程数。static String当前工作目录。static String用户主目录。static String当前用户名。
-
Method Details
-
get
-
get
-
getOsName
-
getOsArch
-
getOsVersion
-
getJavaVersion
-
getJavaHome
-
getUserName
-
getUserDir
-
getUserHome
-
getLineSeparator
-
getFileSeparator
-
getPathSeparator
-
getTotalMemory
public static long getTotalMemory()JVM 总内存(字节)。- Returns:
- 总内存
-
getFreeMemory
public static long getFreeMemory()JVM 空闲内存(字节)。- Returns:
- 空闲内存
-
getMaxMemory
public static long getMaxMemory()JVM 最大可用内存(字节)。- Returns:
- 最大可用内存
-
getTotalThreadCount
public static int getTotalThreadCount()获取当前 JVM 活动线程数。- Returns:
- 线程数
-