This article describes the Java implementation method of obtaining information such as CPU, memory, hard disk, network, etc. Share it for your reference, as follows:
1. Download and install sigar-1.6.4.zip
Using java's own package to obtain system data, it is easy to not find the package, especially the memory information is not accurate enough, so choose to use sigar to obtain system information.
Download address: http://sourceforge.net/projects/sigar/files/latest/download?source=files
Or click here to download this site .
Unzip the compressed package, import sigar.jar under lib into CLASSPATH of eclipse, and then save sigar-x86-winnt.dll into the bin directory of Java.
As shown in the figure below:
2. Code example
import java.net.InetAddress;import java.net.UnknownHostException;import java.util.Map;import java.util.Properties;import org.hyperic.sigar.CpuInfo;import org.hyperic.sigar.CpuPerc;import org.hyperic.sigar.FileSystem;import org.hyperic.sigar.FileSystemUsage;import org.hyperic.sigar.Mem;import org.hyperic.sigar.NetFlags;import org.hyperic.sigar.NetInterfaceConfig;import org.hyperic.sigar.NetInterfaceStat;import org.hyperic.sigar.OperatingSystem;import org.hyperic.sigar.Sigar;import org.hyperic.sigar.SigarException;import org.hyperic.sigar.Swap;import org.hyperic.sigar.Who;public class RuntimeTest { public static void main(String[] args) { try { // System information, obtain property() from jvm; System.out.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- System.out.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- System.getProperties(); InetAddress addr; addr = InetAddress.getLocalHost(); String ip = addr.getHostAddress(); Map<String, String> map = System.getenv(); String userName = map.get("USERNAME");// Get username String computerName = map.get("COMPUTERNAME");// Get computer name String userDomain = map.get("USERDOMAIN");// Get computer domain name System.out.println("Username: " + userName); System.out.println("Computer name: " + computerName); System.out.println("Computer domain name: " + userDomain); System.out.println("Local ip address: " + ip); System.out.println("Local host name: " + addr.getHostName()); System.out.println("Total memory that JVM can use: " + r.totalMemory()); System.out.println("Remaining memory that JVM can use: " + r.freeMemory()); System.out.println("The number of processors that the JVM can use: " + r.availableProcessors()); System.out.println("Java runtime version: " + props.getProperty("java.version")); System.out.println("Java runtime vendor: " + props.getProperty("java.vendor")); System.out.println("Java runtime vendor's URL: " + props.getProperty("java.vendor.url")); System.out.println("Java installation path: " + props.getProperty("java.home")); System.out.println("Java virtual machine specification version: " + props.getProperty("java.vm.specification.version")); System.out.println("Java virtual machine specification vendor: " + props.getProperty("java.vm.specification.vendor")); System.out.println("Java virtual machine specification name: " + props.getProperty("java.vm.specification.name")); System.out.println("Java virtual machine specification version: " + props.getProperty("java.vm.specification.name")); System.out.println("Java virtual machine implementation version: " + props.getProperty("java.vm.version")); System.out.println("Java virtual machine implementation vendor: " + props.getProperty("java.vm.vendor")); System.out.println("Java virtual machine implementation name: " + props.getProperty("java.vm.name")); System.out.println("Java runtime environment specification version: " + props.getProperty("java.specification.version")); System.out.println("Java runtime environment specification vendor: " + props.getProperty("java.specification.version")); System.out.println("Java runtime environment specification vendor: " + props.getProperty("java.specification.vender")); System.out.println("Java runtime environment specification name: " + props.getProperty("java.specification.name")); System.out.println("Java class format version number: " + props.getProperty("java.class.version")); System.out.println("Java classpath: " + props.getProperty("java.class.path")); System.out.println("Path list of searches when loading the library: " + props.getProperty("java.library.path")); System.out.println("Default temporary file path: " + props.getProperty("java.io.tmpdir")); System.out.println("Path to one or more extension directories: " + props.getProperty("java.ext.dirs")); System.out.println("Operational system name: " + props.getProperty("os.name")); System.out.println("Operational system architecture: " + props.getProperty("os.arch")); System.out.println("Operation system version: " + props.getProperty("os.version")); System.out.println("File separator: " + props.getProperty("file.separator")); System.out.println("Path separator: " + props.getProperty("path.separator")); System.out.println("Line separator: " + props.getProperty("line.separator")); System.out.println("User's account name: " + props.getProperty("user.name")); System.out.println("User's home directory: " + props.getProperty("user.home")); System.out.println("User's current working directory: " + props.getProperty("user.dir")); } private static void memory() throws SigarException { Sigar sigar = new Sigar(); Mem mem = sigar.getMem(); // Total memory System.out.println("Total memory: " + mem.getTotal() / 1024L + "K av"); // Current memory usage System.out.println("Current memory usage: " + mem.getUsed() / 1024L + "K used"); // Current memory remaining amount System.out.println("Current memory remaining amount: " + mem.getFree() / 1024L + "K free"); Swap swap = sigar.getSwap(); // Total swap area System.out.println("Total swap area: " + swap.getTotal() / 1024L + "K av"); // Current swap area usage System.out.println("Current swap area usage: " + swap.getUsed() / 1024L + "K used"); // Current swap remaining amount System.out.println("Current swap remaining amount: " + swap.getFree() / 1024L + "K free"); } private static void cpu() throws SigarException { Sigar sigar = new Sigar(); CpuInfo infos[] = sigar.getCpuInfoList(); CpuPerc cpuList[] = null; cpuList = sigar.getCpuPercList(); for (int i = 0; i < infos.length; i++) {// Whether it is a single-block CPU or multiple CPUs, it is applicable to CPUInfo = infos[i]; System.out.println("Thread" + (i + 1) + "Block CPU Information"); System.out.println("Total CPU MHz: " + info.getMhz());// Total CPU MHz System.out.println("CPU Manufacturer: " + info.getVendor());// Seller who obtains CPU, such as: Intel System.out.println("CPU Category: " + info.getModel());// The category of obtaining CPU, such as: Celeron System.out.println("CPU cache number: " + info.getCacheSize());// Number of buffer memory printCpuPerc(cpuList[i]); } } private static void printCpuPerc(CpuPerc cpu) { System.out.println("CPU user usage: " + CpuPerc.format(cpu.getUser()));// User usage System.out.println("CPU system usage: " + CpuPerc.format(cpu.getSys()));// System usage rate System.out.println("CPU current wait rate: " + CpuPerc.format(cpu.getWait()));// Current wait rate System.out.println("CPU current error rate: " + CpuPerc.format(cpu.getNice()));// System.out.println("CPU current idle rate: " + CpuPerc.format(cpu.getIdle()));// Current idle rate System.out.println("Total CPU usage: " + CpuPerc.format(cpu.getCombined()));// Total usage} private static void os() { OperatingSystem OS = OperatingSystem.getInstance(); // Operating system kernel types such as: 386, 486, 586, etc. x86 System.out.println("Operating system: " + OS.getArch()); System.out.println("Operating system CpuEndian(): " + OS.getCpuEndian()); // System.out.println("Operating system DataModel(): " + OS.getDataModel()); // // System Description System.out.println("Operating system description: " + OS.getDescription()); // Operating system type// System.out.println("OS.getName(): " + OS.getName()); // System.out.println("OS.getPatchLevel(): " + OS.getPatchLevel()); // // Operating system seller System.out.println("Operating system seller: " + OS.getVendor()); // Seller name System.out.println("Operating system seller: " + OS.getVendor()); // Seller name System.out.println("Operating system seller: " + OS.getVendorCodeName()); // Operating system name System.out.println("OS name: " + OS.getVendorName()); // Operating system seller type System.out.println("OS seller type: " + OS.getVendorVersion()); // Operating system version number System.out.println("OS version number: " + OS.getVersion()); } private static void who() throws SigarException { Sigar sigar = new Sigar(); Who who[] = sigar.getWhoList(); if (who != null && who.length > 0) { for (int i = 0; i < who.length; i++) { // System.out.println("User name in the current system process table" + String.valueOf(i)); Who _who = who[i]; System.out.println("User console: " + _who.getDevice()); System.out.println("User host: " + _who.getHost()); // System.out.println("getTime(): " + _who.getTime()); // Username in the current system process table System.out.println("Username in the current system process table: " + _who.getUser()); } } } private static void file() throws Exception { Sigar sigar = new Sigar(); FileSystem fslist[] = sigar.getFileSystemList(); for (int i = 0; i < fslist.length; i++) { System.out.println("Disk name of partition" + i); FileSystem fs = fslist[i]; // The disk letter name of the partition System.out.println("Disk name: " + fs.getDevName()); // The disk letter name of the partition System.out.println("Disk path: " + fs.getDirName()); System.out.println("Disk flag: " + fs.getFlags()); // // File system type, such as FAT32, NTFS System.out.println("Disk type: " + fs.getSysTypeName()); // File system type name, such as local hard drive, optical drive, network file system, etc. System.out.println("Disk type name: " + fs.getTypeName()); // File system type System.out.println("Disk file system type: " + fs.getType()); FileSystemUsage usage = null; usage = sigar.getFileSystemUsage(fs.getDirName()); switch (fs.getType()) { case 0: // TYPE_UNKNOWN : Unknown break; case 1: // TYPE_NONE break; case 2: // TYPE_LOCAL_DISK : Local hard disk// Total file system size System.out.println(fs.getDevName() + "Total size: " + usage.getTotal() + "KB"); // File system remaining size System.out.println(fs.getDevName() + "Remaining size: " + usage.getFree() + "KB"); // File system available size System.out.println(fs.getDevName() + "Available size: " + usage.getAvail() + "KB"); // File system used volume System.out.println(fs.getDevName() + "Available size: " + usage.getAvail() + "KB"); // File system used volume System.out.println(fs.getDevName() + "Available size: " + usage.getUsed() + "KB"); double usePercent = usage.getUsePercent() * 100D; // Utilization rate of file system resources System.out.println(fs.getDevName() + "Resource utilization rate: " + usePercent + "%"); break; case 3:// TYPE_NETWORK : Network break; case 4:// TYPE_RAM_DISK : Flash break; case 5:// TYPE_CDROM : Optical drive break; case 6:// TYPE_SWAP : Page exchange break; } System.out.println(fs.getDevName() + "Read: " + usage.getDiskReads()); System.out.println(fs.getDevName() + "Write: " + usage.getDiskWrites()); } return; } private static void net() throws Exception { Sigar sigar = new Sigar(); String ifNames[] = sigar.getNetInterfaceList(); for (int i = 0; i < ifNames.length; i++) { String name = ifNames[i]; NetInterfaceConfig ifconfig = sigar.getNetInterfaceConfig(name); System.out.println("Net device name: " + name);//Net device name System.out.println("IP address: " + ifconfig.getAddress());// IP address System.out.println("Subnet mask: " + ifconfig.getNetmask());// Subnet mask if ((ifconfig.getFlags() & 1L) <= 0L) { System.out.println("!IFF_UP...skipping getNetInterfaceStat"); continue; } NetInterfaceStat ifstat = sigar.getNetInterfaceStat(name); System.out.println(name + "Total number of packages received:" + ifstat.getRxPackets());// Total number of packages received System.out.println(name + "Total number of packages sent:" + ifstat.getTxPackets());// Total number of packages sent System.out.println(name + "Total number of bytes received:" + ifstat.getRxBytes());// Total number of bytes received System.out.println(name + "Total number of bytes sent:" + ifstat.getTxBytes());// Total number of bytes sent System.out.println(name + "Number of error packets received:" + ifstat.getRxErrors());// Number of error packets received System.out.println(name + "Number of errors when sending packets:" + ifstat.getTxErrors());// Number of errors when sending packets System.out.println(name + "Number of packets discarded during reception:" + ifstat.getRxDropped());// Number of packets discarded during reception System.out.println(name + "Number of packets discarded during transmission:" + ifstat.getTxDropped());// Number of packets discarded during transmission} } } private static void ethernet() throws SigarException { Sigar sigar = null; sigar = new Sigar(); String[] ifaces = sigar.getNetInterfaceList(); for (int i = 0; i < ifaces.length; i++) { NetInterfaceConfig cfg = sigar.getNetInterfaceConfig(ifaces[i]); if (NetFlags.LOOPBACK_ADDRESS.equals(cfg.getAddress()) || (cfg.getFlags() & NetFlags.IFF_LOOPBACK) != 0 || NetFlags.NULL_HWADDR.equals(cfg.getHwaddr())) { continue; } System.out.println(cfg.getName() + "IP address:" + cfg.getAddress());// IP address System.out.println(cfg.getName() + "gateway broadcast address:" + cfg.getBroadcast());// Gateway broadcast address System.out.println(cfg.getName() + "Netcard MAC address:" + cfg.getHwaddr());// NNetcard MAC address System.out.println(cfg.getName() + "Subnet mask:" + cfg.getNetmask());// Subnet mask System.out.println(cfg.getName() + "Netcard description information:" + cfg.getDescription());// NNetcard description information System.out.println(cfg.getName() + "Netcard type" + cfg.getType());// } }}The machine run results:
Username: Administrator
Computer name: SNJCKV1VQGB6NP9
Computer domain name: SNJCKV1VQGB6NP9
Local IP address: 192.168.3.37
Local host name: SNJCKV1VQGB6NP9
Total memory that the JVM can use: 16252928
Remaining memory that the JVM can use: 15346992
The number of processors that the JVM can use: 2
Java's running environment version: 1.8.0_121
Java's operating environment vendor: Oracle Corporation
The URL of the Java vendor: http://java.oracle.com/
Java installation path: C:/Program Files/Java/jdk1.8.0/jre
Java Virtual Machine Specification Version: 1.8
Java's virtual machine specification vendor: Oracle Corporation
Java Virtual Machine Specification Name: Java Virtual Machine Specification
Java virtual machine implementation version: 25.121-b13
Java virtual machine implementation vendor: Oracle Corporation
Java virtual machine implementation name: Java HotSpot(TM) Client VM
Java Runtime Environment Specification Version: 1.8
Java Runtime Environment Specification Vendor: null
Java Runtime Environment Specification Name: Java Platform API Specification
Java class format version number: 52.0
Java classpath: C:/jsproot/demo/bin;C:/jsproot/demo/sigar.jar
List of paths searched when loading the library: C:/Program Files/Java/jdk1.8.0/bin;C:/Windows/Sun/Java/bin;C:/Windows/system32;C:/Windows;C:/Program Files/Java/jre1.8.0_162/bin/client;C:/Program Files/Java/jre1.8.0_162/bin;C:/Program Files/Java/jre1.8.0_162/lib/i386;C:/Python36/Scripts/;C:/Python36/;c:/program files/imagemagick-6.2.7-q16;C:/ProgramData/Oracle/Java/javapath;D:/RailsInstaller/Git/cmd;D:/RailsInstaller/Ruby2.1.0/bin;C:/Windows/system32;C:/Windows;C:/Windows/System32/Wbem;C:/Windows/System32/WindowsPowerShell/v1.0/;C:/Program Files/Java/jdk1.8.0/bin;D:/Go/bin;C:/Program Files/Java/jdk1.8.0/bin;C:/Python27/;;D:/Program Files/Lua/5.1;D:/Program Files/Lua/5.1/clibs;C:/wamp/bin/php/php5.2.17;C:/Python27/Scripts;C:/Python27/Lib/site-packages/django/bin;C:/Python27/Scripts;E:/eclipse;;.
Default temporary file path: C:/Users/ADMINI~1/AppData/Local/Temp/
Path to one or more extension directories: C:/Program Files/Java/jdk1.8.0/jre/lib/ext;C:/Windows/Sun/Java/lib/ext
Operating system name: Windows 7
Operating system architecture: x86
Operating system version: 6.1
File delimiter: /
Path separator: ;
Line delimiter:User's account name: Administrator
User's home directory: C:/Users/Administrator
The user's current working directory: C:/jsproot/demo
--------------------------------------------------------------------------------------------------------------------------------
The first CPU information
Total CPU MHz: 2593
CPU manufacturer: Intel
CPU Category: Pentium(R) Dual-Core CPU E5300 @ 2.60GHz
Number of CPU caches: -1
CPU user usage rate: 0.0%
CPU system usage rate: 6.2%
CPU current waiting rate: 0.0%
CPU current error rate: 0.0%
Current CPU idle rate: 93.7%
Total CPU usage: 6.2%
The second CPU information
Total CPU MHz: 2593
CPU manufacturer: Intel
CPU Category: Pentium(R) Dual-Core CPU E5300 @ 2.60GHz
Number of CPU caches: -1
CPU user usage rate: 0.0%
CPU system usage rate: 6.2%
CPU current waiting rate: 0.0%
CPU current error rate: 0.0%
Current CPU idle rate: 93.7%
Total CPU usage: 6.2%
--------------------------------------------------------------------------------------------------------------------------------
Total memory: 3634424K av
Current memory usage: 3264044K used
Current memory remaining: 370380K free
Total number of swap areas: 7791448K av
Current switching area usage: 5324308K used
Current remaining amount of swap area: 2467140K free
--------------------------------------------------------------------------------------------------------------------------------
Operating system: x86
Operating system CpuEndian(): little
Operating system DataModel(): 32
Operating system description: Microsoft Windows 2008
Operating system seller: Microsoft
The name of the seller of the operating system: Longhorn Server
Operating system name: Windows 2008
Operating system seller type: 2008
Operating system version number: 6.1
--------------------------------------------------------------------------------------------------------------------------------
User console: console
User host: NT AUTHORITY
Username in the current system process table: LOCAL SERVICE
User console: console
User host: NT AUTHORITY
Username in the current system process table: NETWORK SERVICE
User console: console
User host: SNJCKV1VQGB6NP9
Username in the current system process table: Administrator
User console: console
User host: NT AUTHORITY
Username in the current system process table: SYSTEM
--------------------------------------------------------------------------------------------------------------------------------
The partition's drive letter name 0
Drive letter name: C:/
Drive letter path: C:/
Drive letter logo: 0
Drive letter type: NTFS
Drive letter type name: local
Drive letter file system type: 2
C:/Total size: 31463268KB
C:/Remaining size: 8582992KB
C:/Available size: 8582992KB
C:/Used amount: 22880276KB
C:/Resource utilization rate: 73.0%
C:/Reading: 177479
C:/Written: 144902
Partition drive letter name 1
Drive letter name: D:/
Drive letter path: D:/
Drive letter logo: 0
Drive letter type: NTFS
Drive letter type name: local
Drive letter file system type: 2
D:/Total size: 153107448KB
D:/Remaining size: 13722816KB
D:/Available size: 13722816KB
D:/Used amount: 139384632KB
D:/Resource utilization rate: 92.0%
D:/Reading: 87425
D:/Written: 25166
Partition drive letter name 2
Drive letter name: E:/
Drive letter path: E:/
Drive letter logo: 0
Drive letter type: NTFS
Drive letter type name: local
Drive letter file system type: 2
E:/Total size: 152055192KB
E:/Remaining size: 20065708KB
E:/Available size: 20065708KB
E:/Used: 131989484KB
E:/Resource utilization rate: 87.0%
E:/Reading: 58883
E:/Written: 1232
Partition drive letter name 3
Drive letter name: F:/
Drive letter path: F:/
Drive letter logo: 0
Drive letter type: NTFS
Drive letter type name: local
Drive letter file system type: 2
F:/Total size: 151757988KB
F:/Remaining size: 14189172KB
F:/Available size: 14189172KB
F:/Used: 137568816KB
F:/Resource utilization rate: 91.0%
F:/Readed: 20639
F:/Written: 14
--------------------------------------------------------------------------------------------------------------------------------
Network device name: eth0
IP address: 0.0.0.0
Subnet mask: 0.0.0.0
Total number of packages received by eth0: 0
Total number of packages sent by eth0: 0
Total number of bytes received by eth0: 0
Total number of bytes sent by eth0: 0
Number of error packets received by eth0: 0
Number of errors when sending packets eth0: 0
Number of packets discarded when eth0 is received: 0
Number of packets discarded when eth0 is sent: 0
Network device name: eth1
IP address: 0.0.0.0
Subnet mask: 0.0.0.0
Total number of packages received by eth1: 0
Total number of packages sent by eth1: 0
Total number of bytes received by eth1: 0
Total number of bytes sent by eth1: 0
Number of error packets received by eth1: 0
Number of errors when eth1 sends packets: 0
Number of packets discarded when eth1 receives: 0
Number of packets discarded when eth1 is sent: 0
Network device name: eth2
IP address: 0.0.0.0
Subnet mask: 0.0.0.0
Total number of packages received by eth2: 387028
Total number of packages sent by eth2: 205197
Total number of bytes received by eth2: 228616339
Total number of bytes sent by eth2: 35841128
Number of error packets received by eth2: 0
Number of errors when eth2 sends packets: 0
Number of packets discarded when eth2 receives: 0
Number of packets discarded when eth2 is sent: 0
Network device name: eth3
IP address: 0.0.0.0
Subnet mask: 0.0.0.0
Total number of packages received by eth3: 387028
Total number of packages sent by eth3: 205197
Total number of bytes received by eth3: 228616339
Total number of bytes sent by eth3: 35841128
Number of error packets received by eth3: 0
Number of errors when eth3 sends packets: 0
Number of packets discarded when eth3 receives: 0
Number of packets discarded when eth3 is sent: 0
Network device name: eth4
IP address: 0.0.0.0
Subnet mask: 0.0.0.0
Total number of packages received by eth4: 0
Total number of packages sent by eth4: 0
Total number of bytes received by eth4: 0
Total number of bytes sent by eth4: 0
Number of error packets received by eth4: 0
Number of errors when eth4 sends packets: 0
Number of packets discarded when eth4 receives: 0
Number of packets discarded when eth4 is sent: 0
Network device name: eth5
IP address: 0.0.0.0
Subnet mask: 0.0.0.0
Total number of packages received by eth5: 0
Total number of packages sent by eth5: 0
Total number of bytes received by eth5: 0
Total number of bytes sent by eth5: 0
Number of error packets received by eth5: 0
Number of errors when eth5 sends packets: 0
Number of packets discarded when eth5 receives: 0
Number of packets discarded when eth5 is sent: 0
Network device name: eth6
IP address: 192.168.3.37
Subnet mask: 255.255.255.0
Total number of packages received by eth6: 387028
Total number of packages sent by eth6: 205197
Total number of bytes received by eth6: 228616339
Total number of bytes sent by eth6: 35841128
Number of error packets received by eth6: 0
Number of errors when eth6 sends packets: 0
Number of packets discarded when eth6 receives: 0
Number of packets discarded when eth6 sends: 0
Network device name: eth7
IP address: 0.0.0.0
Subnet mask: 0.0.0.0
Total number of packages received by eth7: 0
Total number of packages sent by eth7: 0
Total number of bytes received by eth7: 0
Total number of bytes sent by eth7: 0
Number of error packets received by eth7: 0
Number of errors when sending packets in eth7: 0
Number of packets discarded when eth7 receives: 0
Number of packets discarded when eth7 sends: 0
Network device name: eth8
IP address: 0.0.0.0
Subnet mask: 0.0.0.0
Total number of packages received by eth8: 0
Total number of packages sent by eth8: 0
Total number of bytes received by eth8: 0
Total number of bytes sent by eth8: 0
Number of error packets received by eth8: 0
Number of errors when eth8 sends packets: 0
Number of packets discarded when eth8 receives: 0
Number of packets discarded when eth8 sends: 0
Network device name: lo0
IP address: 127.0.0.1
Subnet mask: 255.0.0.0
Lo0 Total number of packages received: 0
Total number of packages sent by lo0: 0
lo0 Total number of bytes received: 0
Total number of bytes sent by lo0: 0
lo0 Number of error packets received: 0
Lo0 Number of errors when sending packets: 0
Lo0 Number of packets discarded when receiving: 0
Lo0 Number of packets discarded when sending: 0
--------------------------------------------------------------------------------------------------------------------------------
eth0IP address: 0.0.0.0
eth0 gateway broadcast address: 0.0.0.0
eth0 network card MAC address: DA:90:20:52:41:53
eth0 subnet mask: 0.0.0.0
eth0 network card description information: WAN Miniport (IPv6)
eth0 network card type Ethernet
eth1IP address: 0.0.0.0
eth1 gateway broadcast address: 0.0.0.0
eth1 network card MAC address: DA:90:20:52:41:53
eth1 subnet mask: 0.0.0.0
eth1 network card description information: WAN Miniport (Network Monitor)
eth1 network card type Ethernet
eth2IP address: 0.0.0.0
eth2 gateway broadcast address: 0.0.0.0
eth2 network card MAC address: E0:CB:4E:07:75:85
eth2 subnet mask: 0.0.0.0
eth2 network card description information: Realtek PCIe GBE Family Controller-QoS Packet Scheduler-0000
eth2 network card type Ethernet
eth3IP address: 0.0.0.0
eth3 gateway broadcast address: 0.0.0.0
eth3 network card MAC address: E0:CB:4E:07:75:85
eth3 subnet mask: 0.0.0.0
eth3 network card description information: Realtek PCIe GBE Family Controller-WFP LightWeight Filter-0000
eth3 network card type Ethernet
eth4IP address: 0.0.0.0
eth4 gateway broadcast address: 0.0.0.0
eth4 network card MAC address: DA:90:20:52:41:53
eth4 subnet mask: 0.0.0.0
eth4 network card description information: WAN Miniport (IP)
eth4 network card type Ethernet
eth5IP address: 0.0.0.0
eth5 gateway broadcast address: 0.0.0.0
eth5 network card MAC address: DA:90:20:52:41:53
eth5 subnet mask: 0.0.0.0
eth5 network card description information: WAN Miniport (Network Monitor)-QoS Packet Scheduler-0000
eth5 network card type Ethernet
eth6IP address: 192.168.3.37
eth6 gateway broadcast address: 192.168.3.255
eth6 network card MAC address: E0:CB:4E:07:75:85
eth6 subnet mask: 255.255.255.0
eth6 network card description information: Realtek PCIe GBE Family Controller
eth6 network card type Ethernet
eth7IP address: 0.0.0.0
eth7 gateway broadcast address: 0.0.0.0
eth7 network card MAC address: DA:90:20:52:41:53
eth7 subnet mask: 0.0.0.0
eth7 network card description information: WAN Miniport (IP)-QoS Packet Scheduler-0000
eth7 network card type Ethernet
eth8IP address: 0.0.0.0
eth8 gateway broadcast address: 0.0.0.0
eth8 network card MAC address: DA:90:20:52:41:53
eth8 subnet mask: 0.0.0.0
eth8 network card description information: WAN Miniport (IPv6)-QoS Packet Scheduler-0000
eth8 network card type Ethernet
--------------------------------------------------------------------------------------------------------------------------------
For more information about Java related content, please check out the topics of this site: "Summary of Java Network Programming Skills", "Summary of Java Socket Programming Skills", "Summary of Java File and Directory Operation Skills", "Tutorial on Java Data Structure and Algorithm", "Summary of Java Operation DOM Node Skills" and "Summary of Java Cache Operation Skills"
I hope this article will be helpful to everyone's Java programming.