How can i find the computer type in Linux using Java ? I need to find out if the device is a laptop/desktop/server/virtual machine.
I managed to find out if the computer is a virtual machine if it is VMWare.
Process virtual = Runtime.getRuntime().exec("sudo dmidecode -s system-manufacturer");
BufferedReader virmar = new BufferedReader(
new InputStreamReader(virtual.getInputStream()));
String s11;
while ((s11 = virmar.readLine()) != null) {
virtualm = s11;
vmName = virtualm;
if (s11.contains("VMware")) {
virtualma = "1";
} else {
virtualma = "";
}
}