Search
 
SCRIPT & CODE EXAMPLE
 

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
}
Comment

PREVIOUS NEXT
Code Example
Java :: java create window 
Java :: import java math 
Java :: print hello world in java 
Java :: java get class by string 
Java :: register listener spigot 
Java :: getcolor deprecated 
Java :: Console color text java 
Java :: java save file dialog 
Java :: gson java maven dependency script google json repository 
Java :: how to loop through code 3 times java 
Java :: java filewriter new line 
Java :: default structure of java 
Java :: simpleListView = (ListView) findViewById(R.id.simpleListView) explain 
Java :: objectmapper maven dependency 
Java :: java selenium new empty tab 
Java :: android java remove imageview source 
Java :: list to int array in java 8 
Java :: array to map java3 
Java :: java android play sound file with variable 
Java :: register command spigot 
Java :: java selenium wait 
Java :: string array to arraylist android 
Java :: java bubble sort 
Java :: update value in hashmap java 
Java :: java remove first element from array 
Java :: android java parse date time 
Java :: java check if bundle has property 
Java :: Integer i = new Integer(257); byte x = i.byteValue(); System.out.print(x); 
Java :: java kommentointi 
Java :: scan.nextline not waiting for input 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =