Searching...
Friday, 25 October 2013

How to get OS name in Java?

10:32

System.getProperty("os.name") return the Operating System name in java.

Example

package com.pretech;
public class OSNameExample {
	public static void main(String[] args) {
		System.out.println(System.getProperty("os.name"));
	}
}

Output



Windows 7


0 comments: