Is it possible to check the current Operating System with Java? I want my program to do something different on Linux.
Something like that
if(os == Linux) {
...
}
Is it possible to check the current Operating System with Java? I want my program to do something different on Linux.
Something like that
if(os == Linux) {
...
}
Try this:
System.getProperty("os.name")
For example:
if("Linux".equals(System.getProperty("os.name"))) {
System.out.println("This is Linux");
}