example:
![]() |
| Get OS name and OS architecture (actually JVM architecture) |
package javaosarch;
public class JavaOsArch {
public static void main(String[] args) {
System.out.println("OS name : "+System.getProperty("os.name"));
System.out.println("OS arch : "+System.getProperty("os.arch"));
}
}
But, please note that System.getProperty("os.arch") actually return JVM architecture, not OS architecture. read more: Beware when detecting 32 and 64 bit OS's in Java

No comments:
Post a Comment