Java program to get the Operating System details
KW.java
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KW OS Name: Linux OS Version: 6.2.0-33-generic OS Architecture: amd64 Java Version: 21 Java Vendor URL: https://java.oracle.com/ kodingwindow@kw:~$
Equivalent Linux commands to get the Operating System details
kodingwindow@kw:~$ uname Linux kodingwindow@kw:~$ uname -s Linux kodingwindow@kw:~$ uname -r 6.2.0-33-generic kodingwindow@kw:~$ javac --version javac 21 kodingwindow@kw:~$ java --version java 21 2023-09-19 LTS Java(TM) SE Runtime Environment (build 21+35-LTS-2513) Java HotSpot(TM) 64-Bit Server VM (build 21+35-LTS-2513, mixed mode, sharing) kodingwindow@kw:~$
Equivalent Windows commands to get the Operating System details
> systeminfo OS Name: Microsoft Windows 11 Home Single Language OS Version: 10.0.22621 N/A Build 22621 System Type: x64-based PC ... > javac --version javac 21 > java --version java 21 2023-09-19 LTS Java(TM) SE Runtime Environment (build 21+35-LTS-2513) Java HotSpot(TM) 64-Bit Server VM (build 21+35-LTS-2513, mixed mode, sharing)
Comments and Reactions
What Next?
How to get the size of heap in Java
Java program to format the text blocks strings using formatted() method
Java Inheritance
Advertisement