本文整理汇总了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";
}
示例2: invokeSys
import org.lwjgl.Sys; //导入方法依赖的package包/类
public void invokeSys() {
Sys.getVersion();
}
示例3: func_74502_a
import org.lwjgl.Sys; //导入方法依赖的package包/类
public String func_74502_a() {
return Sys.getVersion();
}
示例4: getType
import org.lwjgl.Sys; //导入方法依赖的package包/类
public String getType()
{
return Sys.getVersion();
}