Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to detect operating system in java

String os = System.getProperty("os.name").toLowerCase();
if (os.contains("win")){
    //Operating system is based on Windows
}
else if (os.contains("osx")){
    //Operating system is Apple OSX based
}      
else if (os.contains("nix") || os.contains("aix") || os.contains("nux")){
    //Operating system is based on Linux/Unix/*AIX
}
Source by en.code-bude.net #
 
PREVIOUS NEXT
Tagged: #detect #operating #system #java
ADD COMMENT
Topic
Name
4+6 =