Java examples for Native OS:OS
is Gnome
/******************************************************************************* * Copyright (c) 2011 Zeljko Zirikovic.//from w ww . j a va 2 s .c o m * All rights reserved. This program and the accompanying materials * are made available under the terms of the GPL which * accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html ******************************************************************************/ //package com.java2s; import java.security.AccessController; import java.security.PrivilegedAction; public class Main { public static boolean isGnome() { String desktop = ""; try { desktop = AccessController .doPrivileged(new PrivilegedAction<String>() { public String run() { return System.getProperty("sun.desktop"); } }); } catch (Throwable t) { } return "gnome".equals(desktop); } }