2017-04-10 5 views
0

이 오류는 JNI C/C++ dll 라이브러리를로드하려고 시도 할 때 나타납니다. "Java 가상 머신 외부에서 기본 코드로 충돌이 발생했습니다. . " 그게 무슨 뜻인지 모르시겠습니까? 어떤 도움이라도 대단히 감사하겠습니다!Java Runtime Environment에서 치명적인 오류가 감지되었습니다. - .EXCEPTION_ACCESS_VIOLATION

자바 소스 코드는 다음과 같습니다

package demojni; 
public class Main { 
    static { 
     System.load("C:\\Users\\Nicholas1\\Documents\\NetBeansProjects\\DemoJNI_Lib\\dist\\DemoJNI_Lib.dll"); // Load native library at runtime 
            // hello.dll (Windows) or libhello.so (Unixes) 
    } 

    // Declare a native method sayHello() that receives nothing and returns void 


    // Test Driver 
    public static void main(String[] args) { 
     new Main().sayHelloWorld(); // invoke the native method 
    } 
    private native void sayHelloWorld(); 
} 

C-소스 코드는 다음과 같습니다

#include "DemoJNI_Lib.h" 
#include <stdio.h> 

JNIEXPORT void JNICALL Java_demojni_Main_sayHelloWorld 
    (JNIEnv * env, jobject obj){ 
    printf("Hello World \n"); 
} 

JNI C-헤더 소스 코드는 다음과 같습니다 : I 실행

/* DO NOT EDIT THIS FILE - it is machine generated */ 
#include <jni.h> 
/* Header for class demojni_Main */ 

#ifndef _Included_demojni_Main 
#define _Included_demojni_Main 
#ifdef __cplusplus 
extern "C" { 
#endif 
/* 
* Class:  demojni_Main 
* Method: sayHelloWorld 
* Signature:()V 
*/ 
JNIEXPORT void JNICALL Java_demojni_Main_sayHelloWorld 
    (JNIEnv *, jobject); 

#ifdef __cplusplus 
} 
#endif 
#endif 

오류 Main.java 파일 :

# A fatal error has been detected by the Java Runtime Environment: 
# 
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000002c2ed90, pid=7552, tid=0x0000000000001e2c 
# 
# JRE version: Java(TM) SE Runtime Environment (8.0_111-b14) (build 1.8.0_111-b14) 
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.111-b14 mixed mode windows-amd64 compressed oops) 
# Problematic frame: 
# C 0x0000000002c2ed90 
# 
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows 
# 
# An error report file with more information is saved as: 
# C:\Users\Nicholas1\Documents\NetBeansProjects\DemoJNI\hs_err_pid7552.log 
# 
# If you would like to submit a bug report, please visit: 
# http://bugreport.java.com/bugreport/crash.jsp 
# The crash happened outside the Java Virtual Machine in native code. 
# See problematic frame for where to report the bug. 
# 
C:\Users\Nicholas1\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1 
BUILD FAILED (total time: 27 seconds) 

오류 로그 (hs_err_pid7552.log) :

# 
# A fatal error has been detected by the Java Runtime Environment: 
# 
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000002c2ed90, pid=7552, tid=0x0000000000001e2c 
# 
# JRE version: Java(TM) SE Runtime Environment (8.0_111-b14) (build 1.8.0_111-b14) 
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.111-b14 mixed mode windows-amd64 compressed oops) 
# Problematic frame: 
# C 0x0000000002c2ed90 
# 
# 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.java.com/bugreport/crash.jsp 
# The crash happened outside the Java Virtual Machine in native code. 
# See problematic frame for where to report the bug. 
# 

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

Current thread (0x00000000013dd800): JavaThread "main" [_thread_in_native, id=7724, stack(0x0000000002b30000,0x0000000002c30000)] 

siginfo: ExceptionCode=0xc0000005, ExceptionInformation=0x0000000000000008 0x0000000002c2ed90 

Registers: 
RAX=0x000000000000000a, RBX=0x0000000014de0360, RCX=0x00000001802e4ae0, RDX=0x0000000000000000 
RSP=0x0000000002c2f140, RBP=0x0000000002c2f160, RSI=0x0000000020200021, RDI=0x00000000ffffffff 
R8 =0x0000000002c2f0dc, R9 =0x000000018013c900, R10=0x0000000002c30000, R11=0x0000000002c2ed90 
R12=0x0000000000000000, R13=0x0000000014de0360, R14=0x0000000002c2f1f8, R15=0x00000000013dd800 
RIP=0x0000000002c2ed90, EFLAGS=0x0000000000010247 

Top of Stack: (sp=0x0000000002c2f140) 
0x0000000002c2f140: 0000000002c2f400 00000000013dd800 
0x0000000002c2f150: 0000000014de0360 0000000020200021 
0x0000000002c2f160: 0000000002c2f1d8 0000000002d97f74 
0x0000000002c2f170: 00000000013dd9f8 0000000002c2f1f8 
0x0000000002c2f180: 0000000020200021 00000000013dd800 
0x0000000002c2f190: 0000000002d97ca2 0000000002c2f198 
0x0000000002c2f1a0: 0000000014de0360 0000000002c2f1f8 
0x0000000002c2f1b0: 0000000014de0460 0000000000000000 
0x0000000002c2f1c0: 0000000014de0360 0000000000000000 
0x0000000002c2f1d0: 0000000002c2f1f8 0000000002c2f240 
0x0000000002c2f1e0: 0000000002d8835d 0000000000000000 
0x0000000002c2f1f0: 0000000002d919d8 00000000eb26c8f8 
0x0000000002c2f200: 0000000002c2f200 0000000014de02bf 
0x0000000002c2f210: 0000000002c2f250 0000000014de0460 
0x0000000002c2f220: 0000000000000000 0000000014de02d8 
0x0000000002c2f230: 0000000002c2f1f8 0000000002c2f250 

Instructions: (pc=0x0000000002c2ed90) 
0x0000000002c2ed70: 1e 00 1f 00 00 00 00 00 1d fc 1e 80 01 00 00 00 
0x0000000002c2ed80: 00 00 00 00 00 00 00 00 cb 17 2a 47 f8 7f 00 00 
0x0000000002c2ed90: 00 d8 3d 01 00 00 00 00 f8 f1 c2 02 00 00 00 00 
0x0000000002c2eda0: 60 03 de 14 00 00 00 00 00 00 00 00 00 00 00 00 


Register to memory mapping: 

RAX=0x000000000000000a is an unknown value 
RBX={method} {0x0000000014de0368} 'sayHelloWorld' '()V' in 'demojni/Main' 
RCX=0x00000001802e4ae0 is an unknown value 
RDX=0x0000000000000000 is an unknown value 
RSP=0x0000000002c2f140 is pointing into the stack for thread: 0x00000000013dd800 
RBP=0x0000000002c2f160 is pointing into the stack for thread: 0x00000000013dd800 
RSI=0x0000000020200021 is an unknown value 
RDI=0x00000000ffffffff is an unallocated location in the heap 
R8 =0x0000000002c2f0dc is pointing into the stack for thread: 0x00000000013dd800 
R9 =0x000000018013c900 is an unknown value 
R10=0x0000000002c30000 is pointing into the stack for thread: 0x00000000013dd800 
R11=0x0000000002c2ed90 is pointing into the stack for thread: 0x00000000013dd800 
R12=0x0000000000000000 is an unknown value 
R13={method} {0x0000000014de0368} 'sayHelloWorld' '()V' in 'demojni/Main' 
R14=0x0000000002c2f1f8 is pointing into the stack for thread: 0x00000000013dd800 
R15=0x00000000013dd800 is a thread 


Stack: [0x0000000002b30000,0x0000000002c30000], sp=0x0000000002c2f140, free space=1020k 
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) 
C 0x0000000002c2ed90 

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) 
j demojni.Main.sayHelloWorld()V+0 
j demojni.Main.main([Ljava/lang/String;)V+7 
v ~StubRoutines::call_stub 

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

Java Threads: (=> current thread) 
    0x00000000153de000 JavaThread "Service Thread" daemon [_thread_blocked, id=6960, stack(0x0000000017200000,0x0000000017300000)] 
    0x000000001538c000 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=5380, stack(0x0000000016d00000,0x0000000016e00000)] 
    0x0000000015383000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=10140, stack(0x0000000016c00000,0x0000000016d00000)] 
    0x000000001537d800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=6316, stack(0x0000000016b00000,0x0000000016c00000)] 
    0x000000001537c000 JavaThread "Attach Listener" daemon [_thread_blocked, id=10072, stack(0x0000000016a00000,0x0000000016b00000)] 
    0x000000001537a800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=5612, stack(0x0000000016900000,0x0000000016a00000)] 
    0x000000001536a800 JavaThread "Finalizer" daemon [_thread_blocked, id=6568, stack(0x00000000165f0000,0x00000000166f0000)] 
    0x0000000002d6f000 JavaThread "Reference Handler" daemon [_thread_blocked, id=9964, stack(0x00000000164f0000,0x00000000165f0000)] 
=>0x00000000013dd800 JavaThread "main" [_thread_in_native, id=7724, stack(0x0000000002b30000,0x0000000002c30000)] 

Other Threads: 
    0x0000000015346800 VMThread [stack: 0x00000000163f0000,0x00000000164f0000] [id=7392] 
    0x0000000016e48000 WatcherThread [stack: 0x0000000017300000,0x0000000017400000] [id=9832] 

VM state:not at safepoint (normal execution) 

VM Mutex/Monitor currently owned by a thread: None 

Heap: 
PSYoungGen  total 18944K, used 983K [0x00000000eb200000, 0x00000000ec700000, 0x0000000100000000) 
    eden space 16384K, 6% used [0x00000000eb200000,0x00000000eb2f5c90,0x00000000ec200000) 
    from space 2560K, 0% used [0x00000000ec480000,0x00000000ec480000,0x00000000ec700000) 
    to space 2560K, 0% used [0x00000000ec200000,0x00000000ec200000,0x00000000ec480000) 
ParOldGen  total 44032K, used 0K [0x00000000c1600000, 0x00000000c4100000, 0x00000000eb200000) 
    object space 44032K, 0% used [0x00000000c1600000,0x00000000c1600000,0x00000000c4100000) 
Metaspace  used 2593K, capacity 4486K, committed 4864K, reserved 1056768K 
    class space used 282K, capacity 386K, committed 512K, reserved 1048576K 

Card table byte_map: [0x0000000012140000,0x0000000] byte_map_base: 0x0000000011b35000 

Marking Bits: (ParMarkBitMap*) 0x00000000774aa6c0 
Begin Bits: [0x0000000012890000, 0x0000000013838000) 
End Bits: [0x0000000013838000, 0x00000000147e0000) 

Polling page: 0x0000000001210000 

CodeCache: size=245760Kb used=1104Kb max_used=1105Kb free=244655Kb 
bounds [0x0000000002d80000, 0x0000000002ff0000, 0x0000000011d80000] 
total_blobs=255 nmethods=24 adapters=145 
compilation: enabled 

Compilation events (10 events): 
Event: 0.123 Thread 0x000000001538c000 20 s 3  java.lang.StringBuffer::append (13 bytes) 
Event: 0.124 Thread 0x0000000015383000 22  4  java.lang.String::charAt (29 bytes) 
Event: 0.124 Thread 0x000000001538c000 nmethod 20 0x0000000002e90510 code [0x0000000002e906c0, 0x0000000002e90dd8] 
Event: 0.124 Thread 0x000000001538c000 21  3  java.lang.String::equals (81 bytes) 
Event: 0.125 Thread 0x000000001538c000 nmethod 21 0x0000000002e91190 code [0x0000000002e91320, 0x0000000002e91870] 
Event: 0.125 Thread 0x000000001538c000 23  3  java.lang.AbstractStringBuilder::append (50 bytes) 
Event: 0.125 Thread 0x0000000015383000 nmethod 22 0x0000000002e94710 code [0x0000000002e94860, 0x0000000002e94918] 
Event: 0.126 Thread 0x000000001538c000 nmethod 23 0x0000000002e93ad0 code [0x0000000002e93ca0, 0x0000000002e943f8] 
Event: 0.126 Thread 0x000000001538c000 24  3  java.util.Arrays::copyOfRange (63 bytes) 
Event: 0.127 Thread 0x000000001538c000 nmethod 24 0x0000000002e92850 code [0x0000000002e92a60, 0x0000000002e93598] 

GC Heap History (0 events): 
No events 

Deoptimization events (0 events): 
No events 

Internal exceptions (2 events): 
Event: 0.050 Thread 0x00000000013dd800 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.defineClass(Ljava/lang/String;[BII)Ljava/lang/Class; name or signature does not match> (0x00000000eb207c78) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\ 
Event: 0.050 Thread 0x00000000013dd800 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.prefetchRead(Ljava/lang/Object;J)V name or signature does not match> (0x00000000eb207f60) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\prims 

Events (10 events): 
Event: 0.275 loading class java/security/BasicPermissionCollection 
Event: 0.275 loading class java/security/BasicPermissionCollection done 
Event: 0.276 loading class sun/launcher/LauncherHelper$FXHelper 
Event: 0.276 loading class sun/launcher/LauncherHelper$FXHelper done 
Event: 0.276 loading class java/lang/Class$MethodArray 
Event: 0.276 loading class java/lang/Class$MethodArray done 
Event: 0.276 loading class java/lang/Void 
Event: 0.276 loading class java/lang/Void done 
Event: 4.121 Executing VM operation: EnableBiasedLocking 
Event: 4.121 Executing VM operation: EnableBiasedLocking done 


Dynamic libraries: 
0x00007ff6ddee0000 - 0x00007ff6ddf17000  C:\Program Files\Java\jdk1.8.0_111\bin\java.exe 
0x00007ff84a010000 - 0x00007ff84a1bc000  C:\Windows\SYSTEM32\ntdll.dll 
0x00007ff849bf0000 - 0x00007ff849d2e000  C:\Windows\system32\KERNEL32.DLL 
0x00007ff8472a0000 - 0x00007ff8473b5000  C:\Windows\system32\KERNELBASE.dll 
0x00007ff845af0000 - 0x00007ff845b7e000  C:\Windows\system32\apphelp.dll 
0x00007ff822700000 - 0x00007ff822753000  C:\Windows\AppPatch\AppPatch64\AcGenral.DLL 
0x00007ff849b40000 - 0x00007ff849bea000  C:\Windows\system32\msvcrt.dll 
0x00007ff846f40000 - 0x00007ff846f6e000  C:\Windows\SYSTEM32\SspiCli.dll 
0x00007ff8478a0000 - 0x00007ff8478f4000  C:\Windows\system32\SHLWAPI.dll 
0x00007ff847b00000 - 0x00007ff847c77000  C:\Windows\system32\USER32.dll 
0x00007ff8499a0000 - 0x00007ff849b34000  C:\Windows\system32\ole32.dll 
0x00007ff848020000 - 0x00007ff849539000  C:\Windows\system32\SHELL32.dll 
0x00007ff846710000 - 0x00007ff846731000  C:\Windows\SYSTEM32\USERENV.dll 
0x00007ff849760000 - 0x00007ff84980a000  C:\Windows\system32\ADVAPI32.dll 
0x00007ff832a20000 - 0x00007ff832a3e000  C:\Windows\SYSTEM32\MPR.dll 
0x00007ff849540000 - 0x00007ff849681000  C:\Windows\system32\RPCRT4.dll 
0x00007ff8476b0000 - 0x00007ff847709000  C:\Windows\SYSTEM32\sechost.dll 
0x00007ff849df0000 - 0x00007ff84a001000  C:\Windows\SYSTEM32\combase.dll 
0x00007ff847750000 - 0x00007ff8478a0000  C:\Windows\system32\GDI32.dll 
0x00007ff847170000 - 0x00007ff847185000  C:\Windows\SYSTEM32\profapi.dll 
0x00007ff845220000 - 0x00007ff8452d2000  C:\Windows\SYSTEM32\SHCORE.dll 
0x00007ff847710000 - 0x00007ff847746000  C:\Windows\system32\IMM32.DLL 
0x00007ff849810000 - 0x00007ff849962000  C:\Windows\system32\MSCTF.dll 
0x00007ff8448c0000 - 0x00007ff844b3a000  C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.17810_none_6240b9c7ecbd0bda\COMCTL32.dll 
0x00000000505e0000 - 0x00000000506b2000  C:\Program Files\Java\jdk1.8.0_111\jre\bin\msvcr100.dll 
0x0000000076c90000 - 0x000000007752a000  C:\Program Files\Java\jdk1.8.0_111\jre\bin\server\jvm.dll 
0x00007ff83c9a0000 - 0x00007ff83c9a9000  C:\Windows\SYSTEM32\WSOCK32.dll 
0x00007ff844140000 - 0x00007ff844162000  C:\Windows\SYSTEM32\WINMM.dll 
0x00007ff83fad0000 - 0x00007ff83fada000  C:\Windows\SYSTEM32\VERSION.dll 
0x00007ff847900000 - 0x00007ff847907000  C:\Windows\system32\PSAPI.DLL 
0x00007ff847a40000 - 0x00007ff847a9a000  C:\Windows\system32\WS2_32.dll 
0x00007ff843cf0000 - 0x00007ff843d1a000  C:\Windows\SYSTEM32\WINMMBASE.dll 
0x00007ff847c80000 - 0x00007ff847c89000  C:\Windows\system32\NSI.dll 
0x00007ff8475a0000 - 0x00007ff8475ef000  C:\Windows\SYSTEM32\cfgmgr32.dll 
0x00007ff845f60000 - 0x00007ff845f88000  C:\Windows\SYSTEM32\DEVOBJ.dll 
0x0000000050950000 - 0x000000005095f000  C:\Program Files\Java\jdk1.8.0_111\jre\bin\verify.dll 
0x0000000050570000 - 0x0000000050599000  C:\Program Files\Java\jdk1.8.0_111\jre\bin\java.dll 
0x0000000050550000 - 0x0000000050566000  C:\Program Files\Java\jdk1.8.0_111\jre\bin\zip.dll 
0x00000004a4640000 - 0x00000004a465a000  C:\Users\Nicholas1\Documents\NetBeansProjects\DemoJNI_Lib\dist\DemoJNI_Lib.dll 
0x0000000180040000 - 0x0000000180610000  C:\cygwin64\bin\cygwin1.dll 
0x00007ff83ca70000 - 0x00007ff83cbf9000  C:\Windows\SYSTEM32\dbghelp.dll 

VM Arguments: 
jvm_args: -Dfile.encoding=UTF-8 -Djava.library.path=C:\Users\Nicholas1\Documents\NetBeansProjects\DemoJNI_Lib\dist\ 
java_command: demojni.Main 
java_class_path (initial): C:\Users\Nicholas1\Documents\NetBeansProjects\DemoJNI_Lib\dist;C:\Users\Nicholas1\Documents\NetBeansProjects\DemoJNI\build\classes 
Launcher Type: SUN_STANDARD 

Environment Variables: 
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_111 
PATH=C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\SN Systems\PS3\bin;C:\Program Files\Dell\DW WLAN Card;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\WIDCOMM\Bluetooth Software\;c:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Skype\Phone\%M2_HOME%\bin;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Common Files\Ulead Systems\MPEG;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\nodejs\;C:\cygwin64\bin;C:\Program Files\Java\jdk1.8.0_111\bin;C:\Users\Nicholas1\AppData\Roaming\npm;C:\Program Files (x86)\FAHClient 
USERNAME=Nicholas1 
OS=Windows_NT 
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 69 Stepping 1, GenuineIntel 



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

OS: Windows 8.1 , 64 bit Build 9600 (6.3.9600.17415) 

CPU:total 4 (2 cores per cpu, 2 threads per core) family 6 model 69 stepping 1, 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 4096180k(552828k free), swap 9339060k(3424740k free) 

vm_info: Java HotSpot(TM) 64-Bit Server VM (25.111-b14) for windows-amd64 JRE (1.8.0_111-b14), built on Sep 22 2016 19:24:05 by "java_re" with MS VC++ 10.0 (VS2010) 

time: Sun Apr 09 21:29:25 2017 
elapsed time: 27 seconds (0d 0h 0m 27s) 

대 다음 내 연결 내가 컴파일을 위해 다음 단계 및 실행 :

만들기/컴파일 헤더 파일 :

1. Open cmd prompt in “C:\Users\Nicholas1\Documents\NetBeansProjects” 
2. Run “javah –o DemoJNI_Lib/DemoJNI_Lib.h –classpath DemoJNI/src demojni.Main”, where; 
- “DemoJNI_Lib” is your C++ dynamic library project. 
- DemoJNI_Lib.h declaration for your Java/C header for the C-class file. 
- DemoJNI is the name of your java project with src folder. 
- demojni is your java project package name 
- Main is your main java file. 

은 C/C++ 프로젝트의 빌드/링커 옵션 :

1. Right-click on DemoJNI_Lib project and select properties. Go to Build/C Compiler then look under General/Include Directories and click on directories button(…), then select Add button. Now select the include folder from “C:\Program Files\Java\jdk1.8.0_111\include”, then select Add button and select the win32 folder from “C:\Program Files\Java\jdk1.8.0_111\include/win32”, finally choose OK-button. 
2. Right-click on DemoJNI_Lib project and select properties. Go to Build/C-Compiler find “Command Line”/”Additional Options”, then type “-shared –m32” 
3. Right-click on DemoJNI_Lib project and select properties “Build”/”Linker”, find “General”/”Output”, then type dist/DemoJNI_Lib.dll 
4. Optional:Add typedef long long __int64; or #define __int64 long long to top of DemoJNI_Lib.h file. Should be above #include <jni.h>. 
5. Build .dll library file: in Netbeans find C/C++ project with c-file and header-file, then Project->(right click)->Clean and Build. 

실행 자바 파일 :

1. In Netbeans Select DemoJNI java project, Main.java->(Right-click)->Run 
+0

당신과 공유하십시오. 편집, 연결 및 실행에 대해 따라야 할 단계. –

+0

제 YouTube에 대한 귀하의 적시 답변에 대해 Sumeet 씨에게 감사드립니다. 내 원래 질문을 컴파일, 링크 및 JNI 프로젝트 실행으로 업데이트했습니다. –

+0

감사합니다. –

답변

1

는 Cygwin에서 C/C++ 컴파일러와 충돌 오류에 대한 정확한 해결책을 생각하지 않은,하지만이 오류에 대한 대체 솔루션은 마이크로 소프트 비주얼 스튜디오 C/C를 사용하는 것입니다 ++ 컴파일러. https://www.youtube.com/watch?v=tDhOPYi-rYE&spfreload=1

참고 : 여기에

는 마이크로 소프트 비주얼 스튜디오 C/C++ 컴파일러를 사용하는 JNI 솔루션에 대한 링크, 당신은 JNI 개발을위한 마이크로 소프트 비주얼 스튜디오 C/C++ 컴파일러를 사용하는 경우

  • 32 비트 dll의 경우 "C : \ Program Files (x86) \ Microsoft Visual Studio 14.0 \ Common7 \ Tools"에있는 "vsvars32.bat"을 사용하십시오. 내 설치에 대한

  • 나는 64 비트 DLL 파일 그래서 난에서 발견 "vcvars64.bat"사용 필요 "C를 : \ 프로그램 파일 마이크로 소프트 비주얼 스튜디오 14.0 \ VC \ 빈 \의 AMD64 \ (86)"

0

또한 win64 시스템에서 java 8을 업데이트 한 후에이 문제가 해결되었습니다. 로그가 표시되면 "windows-amd64"가 표시됩니다. 그 이유는 무엇입니까? 다음 단계에 따라이 문제를 해결했습니다.
1. Add - Remove programs에서 JAVA 8 업데이트를 제거하십시오.
2. temp 디렉토리가 삭제되었습니다.
3. PC를 다시 시작하십시오.
4. 지금 Java 8을 업데이트하십시오.
5. C:\Program Files\Java\jdk1.8.0_152\lib 경로를 확인하면 "windows-amd64"폴더가 표시되지 않아야합니다.
6. 지금 서버를 확인하십시오.

희망이 도움이됩니다.

관련 문제