当前位置: 首页>>代码示例>>Java>>正文


Java Sys.getVersion方法代码示例

本文整理汇总了Java中org.lwjgl.Sys.getVersion方法的典型用法代码示例。如果您正苦于以下问题:Java Sys.getVersion方法的具体用法?Java Sys.getVersion怎么用?Java Sys.getVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lwjgl.Sys的用法示例。


在下文中一共展示了Sys.getVersion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateCrashLog

import org.lwjgl.Sys; //导入方法依赖的package包/类
public static String generateCrashLog(Thread t, Throwable e) {

        RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();

        String osName = System.getProperty("os.name");
        String osVersion = System.getProperty("os.version");
        String osArch = System.getProperty("os.arch");
        String javaVersion = System.getProperty("java.version");
        String javaVendor = System.getProperty("java.vendor");

        List<String> jvmArgs = runtimeMxBean.getInputArguments();
        StringBuilder builder = new StringBuilder("    ");
        for (String aValue : jvmArgs) builder.append(aValue).append("\n    ");
        if (jvmArgs.size() > 0) {builder.deleteCharAt(builder.length() - 5);} else {builder.append("None");}
        String jvmArgsString = builder.toString();

        String lwjglVersion = Sys.getVersion();
        long processors = Runtime.getRuntime().availableProcessors();
        long heapSize = Runtime.getRuntime().maxMemory();

        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss zzz");
        Date dateObj = new Date();
        String time = df.format(dateObj); //Get the date and time

        return "A fatal error has been thrown within SMB Level Workshop\n" +
                "\n" +
                "===============[ BEGIN CRASH REPORT ]===============\n" +
                "\n" +
                "SMB Level Workshop has crashed!\n" +
                "===============================\n" +
                "\n" +
                String.format("Time: %s\n", time) +
                "\n" +
                "System Information\n" +
                "==================\n" +
                "\n" +
                String.format("Operating System Name: %s\n", osName) +
                String.format("Operating System Version: %s\n", osVersion) +
                String.format("Operating System Architecture: %s\n", osArch) +
                String.format("Java Version: %s\n", javaVersion) +
                String.format("Java Vendor: %s\n", javaVendor) +
                String.format("JVM Arguments:\n%s\n", jvmArgsString) +
                String.format("LWJGL Version: %s\n", lwjglVersion) +
                String.format("OpenGL Version: %s\n", Window.openGLVersion) +
                String.format("Available Processors: %d\n", processors) +
                String.format("Heap Size: %d B (%.2f MiB)\n", heapSize, heapSize / 1048576d) +
                "\n" +
                "Crash Details\n" +
                "=============\n" +
                "\n" +
                String.format("Causing thread: %d \"%s\"\n", t.getId(), t.getName()) +
                "\n" +
                "Stack Trace\n" +
                "===========\n" +
                "\n" +
                String.format("%s\n", getStackTraceString(e)) +
                "\n" +
                "===============[ END CRASH REPORT ]===============\n";
    }
 
开发者ID:CraftedCart,项目名称:SMBLevelWorkshop,代码行数:60,代码来源:CrashHandler.java

示例2: invokeSys

import org.lwjgl.Sys; //导入方法依赖的package包/类
public void invokeSys() {
  Sys.getVersion();
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:4,代码来源:NativeTest.java

示例3: func_74502_a

import org.lwjgl.Sys; //导入方法依赖的package包/类
public String func_74502_a() {
   return Sys.getVersion();
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:4,代码来源:CallableLWJGLVersion.java

示例4: getType

import org.lwjgl.Sys; //导入方法依赖的package包/类
public String getType()
{
    return Sys.getVersion();
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:5,代码来源:CallableLWJGLVersion.java


注:本文中的org.lwjgl.Sys.getVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。