Issue
I have a Java web app that I develop on a Windows machine and will deploy on a Unix machine.
There are some file path settings and permissions details that differ on the two (and there is nothing I can do to change this). Is there some way of detecting which machine the app is sitting on (it's only one of two), either by detecting the operating system or the computer's name so I can then using the appropriate settings.
Solution
Computer name and OS name are two different properties to get computer name use
String computername=InetAddress.getLocalHost().getHostName();
System.out.println(computername);
and to get os name use
java.lang.System.getProperty("os.name")
Abdul Khaliq
Answered By - Abdul Khaliq