I'm making a program When the program is running, it's like Unix or Windows I want to know the operating system of the host, is this possible? Isn't there a 100% reliable way?
java
Use System.getProperty("os.name") to do it.
class ShowProperties {
public static void main(String[] args) {
System.getProperties().list(System.out);
}
}
You can write it like this.
© 2024 OneMinuteCode. All rights reserved.