List of usage examples for org.apache.commons.lang3 SystemUtils OS_ARCH
String OS_ARCH
To view the source code for org.apache.commons.lang3 SystemUtils OS_ARCH.
Click Source Link
The os.arch System Property.
From source file:eu.over9000.skadi.Main.java
private static void printStartupInfo(final String[] args) { LOGGER.info("################################################################################"); LOGGER.info("TIME: " + LocalDateTime.now().toString()); LOGGER.info("OS: " + SystemUtils.OS_NAME + " " + SystemUtils.OS_VERSION + " " + SystemUtils.OS_ARCH); LOGGER.info("JAVA: " + SystemUtils.JAVA_VERSION); LOGGER.info(/*from www . j a v a 2 s . c om*/ " " + SystemUtils.JAVA_RUNTIME_NAME + " <build " + SystemUtils.JAVA_RUNTIME_VERSION + ">"); LOGGER.info("VM: " + SystemUtils.JAVA_VM_NAME + " <build" + SystemUtils.JAVA_VM_VERSION + ", " + SystemUtils.JAVA_VM_INFO + ">"); LOGGER.info("VM-ARGS: " + ManagementFactory.getRuntimeMXBean().getInputArguments()); if (VersionRetriever.isLocalInfoAvailable()) { LOGGER.info("SKADI: " + VersionRetriever.getLocalVersion() + " " + VersionRetriever.getLocalBuild() + " " + VersionRetriever.getLocalTimestamp()); } else { LOGGER.info("SKADI: " + "No local version info available"); } LOGGER.info("ARGS: " + Arrays.asList(args)); LOGGER.info("################################################################################"); }
From source file:io.specto.hoverfly.junit.HoverflyRuleUtils.java
static String getArchitectureType() { return SystemUtils.OS_ARCH.contains("64") ? ARCH_AMD64 : ARCH_386; }
From source file:edu.jhu.jacana.util.PlatformDetection.java
public PlatformDetection() { // resolve OS if (SystemUtils.IS_OS_WINDOWS) { this.os = OS_WINDOWS; } else if (SystemUtils.IS_OS_MAC_OSX) { this.os = OS_OSX; } else if (SystemUtils.IS_OS_SOLARIS) { this.os = OS_SOLARIS; } else if (SystemUtils.IS_OS_LINUX) { this.os = OS_LINUX; } else {//from ww w. j ava2s. c o m throw new IllegalArgumentException("Unknown operating system " + SystemUtils.OS_NAME); } // resolve architecture Map<String, String> archMap = new HashMap<String, String>(); archMap.put("x86", ARCH_X86_32); archMap.put("i386", ARCH_X86_32); archMap.put("i486", ARCH_X86_32); archMap.put("i586", ARCH_X86_32); archMap.put("i686", ARCH_X86_32); archMap.put("x86_64", ARCH_X86_64); archMap.put("amd64", ARCH_X86_64); archMap.put("powerpc", ARCH_PPC); this.arch = archMap.get(SystemUtils.OS_ARCH); if (this.arch == null) { throw new IllegalArgumentException("Unknown architecture " + SystemUtils.OS_ARCH); } }
From source file:com.opentable.db.postgres.embedded.BundledPostgresBinaryResolver.java
/** * Get the machine architecture string. The string is used in the appropriate postgres binary * name./*from w ww .ja va 2 s .c o m*/ * * @return Current machine architecture string. */ private static String getArchitecture() { return "amd64".equals(SystemUtils.OS_ARCH) ? "x86_64" : SystemUtils.OS_ARCH; }
From source file:org.apache.maven.cli.CLIReportingUtils.java
public static String showVersion() { final String ls = System.getProperty("line.separator"); Properties properties = getBuildProperties(); StringBuilder version = new StringBuilder(256); version.append(createMavenVersionString(properties)).append(ls); version.append(reduce(properties.getProperty("distributionShortName") + " home: " + System.getProperty("maven.home", "<unknown Maven " + "home>"))).append(ls); version.append("Java version: ").append(System.getProperty("java.version", "<unknown Java version>")) .append(", vendor: ").append(System.getProperty("java.vendor", "<unknown vendor>")).append(ls); version.append("Java home: ").append(System.getProperty("java.home", "<unknown Java home>")).append(ls); version.append("Default locale: ").append(Locale.getDefault()).append(", platform encoding: ") .append(System.getProperty("file.encoding", "<unknown encoding>")).append(ls); version.append("OS name: \"").append(SystemUtils.OS_NAME).append("\", version: \"") .append(SystemUtils.OS_VERSION).append("\", arch: \"").append(SystemUtils.OS_ARCH); String osFamily = "<unknown family>"; if (SystemUtils.IS_OS_WINDOWS) { osFamily = "Windows"; } else if (SystemUtils.IS_OS_UNIX) { osFamily = "Unix"; }/*from ww w. j a v a 2 s. c o m*/ version.append("\", family: \"").append(osFamily).append('\"'); return version.toString(); }
From source file:org.arquillian.drone.saucelabs.extension.utils.Utils.java
public static boolean is64() { return SystemUtils.OS_ARCH.contains("64"); }
From source file:org.astrojournal.AJMain.java
/** * Main function. By default AstroJournal Main GUI is started. Arguments can * be passed. Please see AJMainConsole.printHelp() for options. * //from ww w . j ava 2s . co m * @param args */ public static void main(String[] args) { // Get some information for debugging log.debug("Application: " + AJMetaInfo.NAME.getInfo() + " " + AJMetaInfo.VERSION.getInfo()); log.debug("Operating System: " + SystemUtils.OS_ARCH + " " + SystemUtils.OS_NAME + " " + SystemUtils.OS_VERSION); log.debug("Java: " + SystemUtils.JAVA_VENDOR + " " + SystemUtils.JAVA_VERSION); // Initialise dependency injection with Spring ApplicationContext context = new ClassPathXmlApplicationContext("META-INF/aj_spring_default_context.xml"); BeanFactory factory = context; Configuration config = (Configuration) factory.getBean("configuration"); ConfigurationUtils configUtils = config.getConfigurationUtils(); try { if (args.length == 0) { Generator generator = (Generator) factory.getBean("generator"); startAJMainGUI(generator, config); } else if (args[0].equals("-f") || args[0].equals("--config")) { log.info(configUtils.printConfiguration(config)); } else if (args[0].equals("-c") || args[0].equals("--console")) { AJMainConsole.main(args); } else if (args[0].equals("-h") || args[0].equals("--help")) { log.info(AJMainConsole.printHelp()); } else if (args[0].equals("--license")) { log.info(AJMetaInfo.SHORT_LICENSE.getInfo()); } else if (args[0].equals("-t") || args[0].equals("--test-latex")) { log.info(configUtils.printPDFLatexVersion(config)); } else { log.fatal( "Unrecognised option. Please, run AstroJournal with the option -h [--help] for suggestions."); } } catch (Exception ex) { log.error(ex, ex); } }
From source file:org.cryptomator.ui.Cryptomator.java
public static void main(String[] args) { LOG.info("Starting Cryptomator {} on {} {} ({})", ApplicationVersion.orElse("SNAPSHOT"), SystemUtils.OS_NAME, SystemUtils.OS_VERSION, SystemUtils.OS_ARCH); if (SystemUtils.IS_OS_MAC_OSX) { addOsxFileOpenHandler();/*from ww w . j av a 2s .c om*/ } new CleanShutdownPerformer().registerShutdownHook(); final Optional<RemoteInstance> runningInstance = SingleInstanceManager .getRemoteInstance(MainApplication.APPLICATION_KEY); if (runningInstance.isPresent()) { sendArgsToRunningInstance(args, runningInstance); } else { Application.launch(MainApplication.class, args); } }
From source file:org.graylog.plugins.usagestatistics.collectors.NodeCollector.java
private JvmInfo buildJvmSpecs() { final JvmStats jvmStats = statsService.jvmStats(); final JvmInfo.Os os = JvmInfo.Os.create(SystemUtils.OS_NAME, SystemUtils.OS_VERSION, SystemUtils.OS_ARCH); final JvmInfo.Memory jvmMemory = JvmInfo.Memory.create(jvmStats.mem().heapInit(), jvmStats.mem().heapMax(), jvmStats.mem().nonHeapInit(), jvmStats.mem().nonHeapMax(), jvmStats.mem().directMemoryMax()); return JvmInfo.create(jvmStats.version(), jvmStats.vmName(), jvmStats.vmVersion(), jvmStats.vmVendor(), os, jvmMemory, jvmStats.garbageCollectors()); }
From source file:org.yamj.common.model.YamjInfo.java
@SuppressWarnings("rawtypes") public YamjInfo(Class myClass) { // YAMJ Stuff this.projectName = myClass.getPackage().getImplementationVendor(); this.projectVersion = myClass.getPackage().getImplementationVersion(); this.moduleName = myClass.getPackage().getImplementationTitle(); this.moduleDescription = myClass.getPackage().getSpecificationTitle(); if (myClass.getPackage().getSpecificationVendor() != null) { this.buildDateTime = DateTimeTools.parseDate(myClass.getPackage().getSpecificationVendor(), DateTimeTools.BUILD_FORMAT); } else {/*from ww w . ja va 2 s . c o m*/ this.buildDateTime = new DateTime(); } this.buildRevision = myClass.getPackage().getSpecificationVersion(); // System Stuff this.processorCores = Runtime.getRuntime().availableProcessors(); this.javaVersion = SystemUtils.JAVA_VERSION; this.osArch = SystemUtils.OS_ARCH; this.osName = SystemUtils.OS_NAME; this.osVersion = SystemUtils.OS_VERSION; // Times this.startUpDateTime = new DateTime(ManagementFactory.getRuntimeMXBean().getStartTime()); // Counts this.counts = new EnumMap<MetaDataType, Long>(MetaDataType.class); // IP Address this.coreIp = SystemTools.getIpAddress(Boolean.TRUE); // Core Port this.corePort = 8888; // TODO: Get this from jetty! // Database IP & Name findDatabaseInfo(); this.baseArtworkUrl = buildBaseUrl(PropertyTools.getProperty("yamj3.file.storage.artwork", "")); this.baseMediainfoUrl = buildBaseUrl(PropertyTools.getProperty("yamj3.file.storage.mediainfo", "")); this.basePhotoUrl = buildBaseUrl(PropertyTools.getProperty("yamj3.file.storage.photo", "")); this.skinDir = buildBaseUrl(PropertyTools.getProperty("yamj3.file.storage.skins", "./skins/")); }