如何使用“无法写入核心转储”来解决致命错误“EXCEPTION_ACCES_VIOLATION”。

时间:2015-12-02 20:10:36

标签: java intellij-idea

我想在之前创建的一个帖子中创建一个窗口,在ItelliJ IDEA上可以提供帮助。 实际上我正在关注this youtube guide(直到22:55)。

完整的错误如下:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000005d283b6f, pid=5112, tid=9000
#
# JRE version: Java(TM) SE Runtime Environment (8.0_25-b18) (build 1.8.0_25-b18)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V  [jvm.dll+0x1d3b6f]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x00000000167f1000):  JavaThread "Game" [_thread_in_vm, id=9000, stack(0x0000000016df0000,0x0000000016ef0000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x0000000000000780

Registers:
RAX=0x00000000167f1000, RBX=0x00000000167f1000, RCX=0x000000000000001f, RDX=0x0000000016eef018
RSP=0x0000000016eeef40, RBP=0x0000000016eeefe8, RSI=0x0000000000200021, RDI=0x0000000000000780
R8 =0x0000000000000780, R9 =0x00000000eb4bdad0, R10=0x0000000002895b48, R11=0x000000005d2c2810
R12=0x0000000000000000, R13=0x000000001456a938, R14=0x0000000016eef018, R15=0x00000000167f1000
RIP=0x000000005d283b6f, EFLAGS=0x0000000000010246

Top of Stack: (sp=0x0000000016eeef40)
0x0000000016eeef40:   0000000016eef088 00000000148f2c80
0x0000000016eeef50:   0000000014956868 00000000167f1000
0x0000000016eeef60:   0000000002887470 0000000002895b74
0x0000000016eeef70:   000000001456a938 0000000016eeefe8
0x0000000016eeef80:   0000000000200021 00000000148f2028
0x0000000016eeef90:   00000000000000b8 00000000167f1000
0x0000000016eeefa0:   0000000000000000 0000000016eeefa8
0x0000000016eeefb0:   0000000000000000 0000000016eef018
0x0000000016eeefc0:   00000000145859c0 0000000000000000
0x0000000016eeefd0:   000000001456a938 0000000000000000
0x0000000016eeefe0:   0000000016eef008 0000000016eef060
0x0000000016eeeff0:   0000000002887470 0000000000000000
0x0000000016eef000:   000000000288f6b6 0000000000000780
0x0000000016eef010:   0000000000000000 00000000eb18d698
0x0000000016eef020:   0000000016eef020 000000001492eb24
0x0000000016eef030:   0000000016eef080 0000000014932248 

Instructions: (pc=0x000000005d283b6f)
0x000000005d283b4f:   4a 05 00 c7 83 60 02 00 00 06 00 00 00 8b 0d d6
0x000000005d283b5f:   a1 5a 00 ff 15 80 08 3e 00 c6 80 84 02 00 00 01
0x000000005d283b6f:   8b 2f c6 80 84 02 00 00 00 48 8b 7b 48 48 8b 47
0x000000005d283b7f:   10 48 8b 77 08 48 83 38 00 74 15 48 8b 57 28 48 


Register to memory mapping:

RAX=0x00000000167f1000 is a thread
RBX=0x00000000167f1000 is a thread
RCX=0x000000000000001f is an unknown value
RDX=0x0000000016eef018 is pointing into the stack for thread: 0x00000000167f1000
RSP=0x0000000016eeef40 is pointing into the stack for thread: 0x00000000167f1000
RBP=0x0000000016eeefe8 is pointing into the stack for thread: 0x00000000167f1000
RSI=0x0000000000200021 is an unknown value
RDI=0x0000000000000780 is an unknown value
R8 =0x0000000000000780 is an unknown value
R9 =0x00000000eb4bdad0 is an oop
java.lang.Class 
 - klass: 'java/lang/Class'
R10=0x0000000002895b48 is at code_begin+840 in an Interpreter codelet
method entry point (kind = native)  [0x0000000002895800, 0x0000000002896160]  2400 bytes
R11=0x000000005d2c2810 is an unknown value
R12=0x0000000000000000 is an unknown value
R13={method} {0x000000001456a940} 'getInt' '(J)I' in 'sun/misc/Unsafe'
R14=0x0000000016eef018 is pointing into the stack for thread: 0x00000000167f1000
R15=0x00000000167f1000 is a thread


Stack: [0x0000000016df0000,0x0000000016ef0000],  sp=0x0000000016eeef40,  free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0x1d3b6f]
C  0x0000000002895b74

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  sun.misc.Unsafe.getInt(J)I+0
j  org.lwjgl.system.MemoryAccess$MemoryAccessorUnsafe.memGetInt(J)I+4
j  org.lwjgl.system.MemoryUtil.memGetInt(J)I+4
j  org.lwjgl.glfw.GLFWVidMode.nwidth(J)I+6
j  Main.init()V+59
j  Main.run()V+1
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x00000000026ee000 JavaThread "DestroyJavaVM" [_thread_blocked, id=1336, stack(0x00000000025a0000,0x00000000026a0000)]
=>0x00000000167f1000 JavaThread "Game" [_thread_in_vm, id=9000, stack(0x0000000016df0000,0x0000000016ef0000)]
  0x00000000167d9800 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=3672, stack(0x0000000016cf0000,0x0000000016df0000)]
  0x0000000014eed800 JavaThread "Service Thread" daemon [_thread_blocked, id=10028, stack(0x0000000016af0000,0x0000000016bf0000)]
  0x0000000014e98000 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=7928, stack(0x00000000165f0000,0x00000000166f0000)]
  0x0000000014e91800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=10196, stack(0x00000000164f0000,0x00000000165f0000)]
  0x0000000014e8e800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=5496, stack(0x00000000163f0000,0x00000000164f0000)]
  0x0000000014e8d000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4916, stack(0x00000000162f0000,0x00000000163f0000)]
  0x0000000014e8c000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=7920, stack(0x00000000161f0000,0x00000000162f0000)]
  0x0000000002876800 JavaThread "Finalizer" daemon [_thread_blocked, id=9636, stack(0x00000000160f0000,0x00000000161f0000)]
  0x0000000014e58800 JavaThread "Reference Handler" daemon [_thread_blocked, id=7608, stack(0x0000000015ff0000,0x00000000160f0000)]

Other Threads:
  0x0000000014e57000 VMThread [stack: 0x0000000015ef0000,0x0000000015ff0000] [id=8024]
  0x0000000016708000 WatcherThread [stack: 0x0000000016bf0000,0x0000000016cf0000] [id=9784]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap:
 PSYoungGen      total 18944K, used 3933K [0x00000000eb180000, 0x00000000ec680000, 0x0000000100000000)
  eden space 16384K, 24% used [0x00000000eb180000,0x00000000eb557448,0x00000000ec180000)
  from space 2560K, 0% used [0x00000000ec400000,0x00000000ec400000,0x00000000ec680000)
  to   space 2560K, 0% used [0x00000000ec180000,0x00000000ec180000,0x00000000ec400000)
 ParOldGen       total 44032K, used 0K [0x00000000c1400000, 0x00000000c3f00000, 0x00000000eb180000)
  object space 44032K, 0% used [0x00000000c1400000,0x00000000c1400000,0x00000000c3f00000)
 Metaspace       used 3894K, capacity 4984K, committed 5120K, reserved 1056768K
  class space    used 414K, capacity 424K, committed 512K, reserved 1048576K

Card table byte_map: [0x0000000011c40000,0x0000000011e40000] byte_map_base: 0x0000000011636000

Marking Bits: (ParMarkBitMap*) 0x000000005d88d490
 Begin Bits: [0x0000000012390000, 0x0000000013340000)
 End Bits:   [0x0000000013340000, 0x00000000142f0000)

Polling page: 0x0000000000db0000

CodeCache: size=245760Kb used=1445Kb max_used=1458Kb free=244314Kb
 bounds [0x0000000002880000, 0x0000000002af0000, 0x0000000011880000]
 total_blobs=586 nmethods=151 adapters=349
 compilation: enabled

Compilation events (10 events):
Event: 0.362 Thread 0x0000000014e98000 nmethod 144 0x00000000029e6c90 code [0x00000000029e6e20, 0x00000000029e7198]
Event: 0.471 Thread 0x0000000014e98000  146       3       java.lang.String::<init> (10 bytes)
Event: 0.472 Thread 0x0000000014e98000 nmethod 146 0x00000000029e7690 code [0x00000000029e77e0, 0x00000000029e79b0]
Event: 0.472 Thread 0x0000000014e98000  147       1       sun.misc.URLClassPath$JarLoader::access$500 (5 bytes)
Event: 0.472 Thread 0x0000000014e98000 nmethod 147 0x00000000029e7a50 code [0x00000000029e7ba0, 0x00000000029e7c90]
Event: 0.472 Thread 0x0000000014e98000  148       3       java.util.zip.Inflater::ensureOpen (47 bytes)
Event: 0.473 Thread 0x0000000014e98000 nmethod 148 0x00000000029e7d10 code [0x00000000029e7e80, 0x00000000029e8148]
Event: 0.473 Thread 0x0000000014e98000  149  s    3       sun.misc.PerfCounter::add (18 bytes)
Event: 0.473 Thread 0x0000000014e98000 nmethod 149 0x00000000029e8250 code [0x00000000029e83e0, 0x00000000029e8a58]
Event: 0.475 Thread 0x0000000014e91800  151       4       sun.nio.cs.UTF_8$Encoder::encode (359 bytes)

GC Heap History (0 events):
No events

Deoptimization events (0 events):
No events

Internal exceptions (10 events):
Event: 0.329 Thread 0x00000000167f1000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000eb5059a8) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u25\1677\hotspot\src\share\vm\prims\jvm.cpp, line 1312]
Event: 0.329 Thread 0x00000000167f1000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000eb50a1d0) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u25\1677\hotspot\src\share\vm\prims\jvm.cpp, line 1312]
Event: 0.330 Thread 0x00000000167f1000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000eb50df98) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u25\1677\hotspot\src\share\vm\prims\jvm.cpp, line 1312]
Event: 0.335 Thread 0x00000000167f1000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000eb51af40) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u25\1677\hotspot\src\share\vm\prims\jvm.cpp, line 1312]
Event: 0.362 Thread 0x00000000167f1000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000eb5266c0) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u25\1677\hotspot\src\share\vm\prims\jvm.cpp, line 1312]
Event: 0.470 Thread 0x00000000167f1000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000eb52abd0) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u25\1677\hotspot\src\share\vm\prims\jvm.cpp, line 1312]
Event: 0.471 Thread 0x00000000167f1000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000eb530608) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u25\1677\hotspot\src\share\vm\prims\jvm.cpp, line 1312]
Event: 0.473 Thread 0x00000000167f1000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000eb536120) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u25\1677\hotspot\src\share\vm\prims\jvm.cpp, line 1312]
Event: 0.474 Thread 0x00000000167f1000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000eb53a420) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u25\1677\hotspot\src\share\vm\prims\jvm.cpp, line 1312]
Event: 0.475 Thread 0x00000000167f1000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000eb53dd50) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u25\1677\hotspot\src\share\vm\prims\jvm.cpp, line 1312]

Events (10 events):
Event: 0.470 loading class org/lwjgl/glfw/GLFWVidMode
Event: 0.470 loading class org/lwjgl/glfw/GLFWVidMode done
Event: 0.471 loading class org/lwjgl/system/Struct
Event: 0.471 loading class org/lwjgl/system/Struct done
Event: 0.473 loading class org/lwjgl/system/PointerWrapper
Event: 0.473 loading class org/lwjgl/system/PointerWrapper done
Event: 0.474 loading class org/lwjgl/system/Struct$Member
Event: 0.474 loading class org/lwjgl/system/Struct$Member done
Event: 0.475 loading class org/lwjgl/system/Struct$Layout
Event: 0.475 loading class org/lwjgl/system/Struct$Layout done


Dynamic libraries:
0x00007ff6fe530000 - 0x00007ff6fe564000     C:\Program Files\Java\jdk1.8.0_25\bin\java.exe
0x00007ff90cd00000 - 0x00007ff90ceac000     C:\Windows\SYSTEM32\ntdll.dll
0x00007ff90a6a0000 - 0x00007ff90a7de000     C:\Windows\system32\KERNEL32.DLL
0x00007ff90a020000 - 0x00007ff90a135000     C:\Windows\system32\KERNELBASE.dll
0x00007ff9089f0000 - 0x00007ff908a7e000     C:\Windows\system32\apphelp.dll
0x00007ff8f1200000 - 0x00007ff8f1253000     C:\Windows\AppPatch\AppPatch64\AcGenral.DLL
0x00007ff90cb00000 - 0x00007ff90cbaa000     C:\Windows\system32\msvcrt.dll
0x00007ff909cf0000 - 0x00007ff909d1e000     C:\Windows\SYSTEM32\SspiCli.dll
0x00007ff90a5d0000 - 0x00007ff90a624000     C:\Windows\system32\SHLWAPI.dll
0x00007ff90aa00000 - 0x00007ff90ab77000     C:\Windows\system32\USER32.dll
0x00007ff90ae30000 - 0x00007ff90afc4000     C:\Windows\system32\ole32.dll
0x00007ff90afe0000 - 0x00007ff90c50b000     C:\Windows\system32\SHELL32.dll
0x00007ff909450000 - 0x00007ff909471000     C:\Windows\SYSTEM32\USERENV.dll
0x00007ff90c530000 - 0x00007ff90c5da000     C:\Windows\system32\ADVAPI32.dll
0x00007ff8f8f10000 - 0x00007ff8f8f2e000     C:\Windows\SYSTEM32\MPR.dll
0x00007ff90a3e0000 - 0x00007ff90a521000     C:\Windows\system32\RPCRT4.dll
0x00007ff90a630000 - 0x00007ff90a689000     C:\Windows\SYSTEM32\sechost.dll
0x00007ff90a7e0000 - 0x00007ff90a9f1000     C:\Windows\SYSTEM32\combase.dll
0x00007ff90cbb0000 - 0x00007ff90ccff000     C:\Windows\system32\GDI32.dll
0x00007ff909e50000 - 0x00007ff909e65000     C:\Windows\SYSTEM32\profapi.dll
0x00007ff9083a0000 - 0x00007ff908452000     C:\Windows\SYSTEM32\SHCORE.dll
0x00007ff90a590000 - 0x00007ff90a5c6000     C:\Windows\system32\IMM32.DLL
0x00007ff90c7d0000 - 0x00007ff90c922000     C:\Windows\system32\MSCTF.dll
0x00007ff907f20000 - 0x00007ff90819b000     C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.18006_none_623f33d3ecbe86e8\COMCTL32.dll
0x000000005d910000 - 0x000000005d9e2000     C:\Program Files\Java\jdk1.8.0_25\jre\bin\msvcr100.dll
0x000000005d0b0000 - 0x000000005d90a000     C:\Program Files\Java\jdk1.8.0_25\jre\bin\server\jvm.dll
0x00007ff8ff6b0000 - 0x00007ff8ff6b9000     C:\Windows\SYSTEM32\WSOCK32.dll
0x00007ff9079c0000 - 0x00007ff9079e2000     C:\Windows\SYSTEM32\WINMM.dll
0x00007ff90afd0000 - 0x00007ff90afd7000     C:\Windows\system32\PSAPI.DLL
0x00007ff90a380000 - 0x00007ff90a3da000     C:\Windows\system32\WS2_32.dll
0x00007ff9078c0000 - 0x00007ff9078ea000     C:\Windows\SYSTEM32\WINMMBASE.dll
0x00007ff90c510000 - 0x00007ff90c519000     C:\Windows\system32\NSI.dll
0x00007ff909f20000 - 0x00007ff909f6f000     C:\Windows\SYSTEM32\cfgmgr32.dll
0x00007ff908c40000 - 0x00007ff908c68000     C:\Windows\SYSTEM32\DEVOBJ.dll
0x000000005e8b0000 - 0x000000005e8bf000     C:\Program Files\Java\jdk1.8.0_25\jre\bin\verify.dll
0x000000005d080000 - 0x000000005d0a8000     C:\Program Files\Java\jdk1.8.0_25\jre\bin\java.dll
0x000000005d060000 - 0x000000005d076000     C:\Program Files\Java\jdk1.8.0_25\jre\bin\zip.dll
0x00007ff9088d0000 - 0x00007ff9088e0000     F:\Logiciels\IntelliJ IDEA\IntelliJ IDEA 14.1.5\bin\breakgen64.dll
0x000000005d040000 - 0x000000005d05a000     C:\Program Files\Java\jdk1.8.0_25\jre\bin\net.dll
0x00007ff909830000 - 0x00007ff909889000     C:\Windows\system32\mswsock.dll
0x00007ff8ea5c0000 - 0x00007ff8ea648000     F:\Logiciels\Eclipse\Workspace\Duju\native\lwjgl.dll
0x00007ff909d90000 - 0x00007ff909d9b000     C:\Windows\SYSTEM32\CRYPTBASE.DLL
0x00007ff909d20000 - 0x00007ff909d83000     C:\Windows\SYSTEM32\bcryptPrimitives.dll
0x00007ff8ea2e0000 - 0x00007ff8ea322000     F:\Logiciels\Eclipse\Workspace\Duju\native\jemalloc.dll
0x00007ff8ee6a0000 - 0x00007ff8ee6d8000     F:\Logiciels\Eclipse\Workspace\Duju\native\glfw.dll
0x00007ff908ac0000 - 0x00007ff908be9000     C:\Windows\system32\uxtheme.dll
0x00007ff9081a0000 - 0x00007ff9081c1000     C:\Windows\SYSTEM32\dwmapi.dll
0x00007ff8ee200000 - 0x00007ff8ee32b000     C:\Windows\SYSTEM32\opengl32.dll
0x00007ff8f6090000 - 0x00007ff8f60be000     C:\Windows\SYSTEM32\GLU32.dll
0x00007ff8ecc80000 - 0x00007ff8ecd78000     C:\Windows\SYSTEM32\DDRAW.dll
0x00007ff906fa0000 - 0x00007ff906fa9000     C:\Windows\SYSTEM32\DCIMAN32.dll
0x00007ff8d6ea0000 - 0x00007ff8d77cd000     C:\Windows\SYSTEM32\ig75icd64.dll
0x00007ff8eeae0000 - 0x00007ff8ef4bd000     C:\Windows\SYSTEM32\igdusc64.dll
0x00007ff9089d0000 - 0x00007ff9089e2000     C:\Windows\SYSTEM32\WTSAPI32.dll
0x00007ff9094d0000 - 0x00007ff909516000     C:\Windows\SYSTEM32\powrprof.dll
0x00007ff908cb0000 - 0x00007ff908cbb000     C:\Windows\SYSTEM32\kernel.appcore.dll
0x00007ff8f9c20000 - 0x00007ff8f9da9000     C:\Windows\SYSTEM32\dbghelp.dll

VM Arguments:
jvm_args: -Djava.library.path=native/ -Didea.launcher.port=7536 -Didea.launcher.bin.path=F:\Logiciels\IntelliJ IDEA\IntelliJ IDEA 14.1.5\bin -Dfile.encoding=windows-1252 
java_command: com.intellij.rt.execution.application.AppMain Main
java_class_path (initial): C:\Program Files\Java\jdk1.8.0_25\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_25\jre\lib\ext\zipfs.jar;F:\Logiciels\Eclipse\Workspace\Duju\out\production\Duju;F:\Logiciels\Eclipse\Workspace\Duju\jar\lwjgl.jar;F:\Logiciels\IntelliJ IDEA\IntelliJ IDEA 14.1.5\lib\idea_rt.jar
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_25
PATH=F:\Logiciels\OCaml\emacs-23.3\bin;F:\Logiciels\OCaml\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\
USERNAME=Alex
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 60 Stepping 3, GenuineIntel



---------------  S Y S T E M  ---------------

OS: Windows 8.1 , 64 bit Build 9600 

CPU:total 4 (2 cores per cpu, 2 threads per core) family 6 model 60 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2

Memory: 4k page, physical 4110944k(899212k free), swap 8305248k(2328032k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (25.25-b02) for windows-amd64 JRE (1.8.0_25-b18), built on Oct  7 2014 14:25:37 by "java_re" with MS VC++ 10.0 (VS2010)

time: Wed Dec 02 20:49:40 2015
elapsed time: 0 seconds (0d 0h 0m 0s)

我尝试了在类似帖子中看到的所有内容:我已经卸载/重新安装了java,更改了项目/工作区文件夹,禁用了Windows UAC ...

这是我的代码:

import org.lwjgl.glfw.GLFWVidMode;

import static org.lwjgl.glfw.GLFW.*;
import static org.lwjgl.opengl.GL11.GL_TRUE;
import static org.lwjgl.system.MemoryUtil.NULL;

/**
 * Created by Alex on 02/12/2015.
 */
public class Main implements Runnable{

    //Taille de la fenetre
    private int width = 1280;
    private int height = 720;

    private Thread thread;
    private boolean running = false;

    private long window;


    public void start() {
        running = true;
        thread = new Thread(this, "Game");
        thread.start();




        /*glfwInit();

        createCapabilities(); // Links LWJGL to the OpenGL context

        // Enter the update loop: keep refreshing the window as long as the window isn't closed
        while (glfwWindowShouldClose(window) == GL_FALSE) {
            // Clear the contents of the window (try disabling this and resizing the window – fun guaranteed)
            glClear(GL_COLOR_BUFFER_BIT);
            glfwSwapBuffers(window);
            glfwPollEvents();
        }

        glfwDestroyWindow(window);
        glfwTerminate();*/



    }

    private void init() {
        if(glfwInit() != GL_TRUE) {
            //TODO : gerer ce cas ou l'initialisation du GLFW a plante.
            return;
        }

        glfwWindowHint(GLFW_RESIZABLE, GL_TRUE);
        // Configuration de la fenetre
        window = glfwCreateWindow(width, height, "Duju", NULL, NULL);

        if (window == NULL) {
            //TODO : gerer le cas ou la fenetre est nulle.
            return;
        }

        //Pour placer la fenetre au centre, on get le video mode
        GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor());
        //Set la position
        glfwSetWindowPos(window, GLFWVidMode.nwidth(vidmode.width()) /2, GLFWVidMode.nheight(vidmode.height()) /2);
        //Si on a des objets, on la set comme ca
        //window.setPos(xpos,ypos);
        glfwMakeContextCurrent(window);
        glfwSwapInterval(1); // VSync pour caper a 60fps
        glfwShowWindow(window);


    }

    //Lance quand le thread est cree
    public void run() {
        init();
        while (running) {
            update();
            render();

            if (glfwWindowShouldClose(window) == GL_TRUE)
                running = false;
        }
    }

    private void update() {
        glfwPollEvents();
    }

    private void render() {
        glfwSwapBuffers(window);
    }

    public static void main(String[] args) {
        new Main().start();
    }

}

1 个答案:

答案 0 :(得分:0)

好的,所以我使用了这样的保险箱.width()glfwSetWindowPos(window, vidmode.width() /2, vidmode.height()/2);。它运作良好。