- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在用 C++ 编写我的第一个 JNI 程序,并制作了一些测试方法以确保一切正常。
问题是:当我调用方法测试时,它给出的结果波动很大。有时它会永远运行,有时我会遇到构建错误,有时我会收到 fatal error 和错误消息。这不仅发生在 printf 和 std::cout 上,而且发生在方法调用上(然后我总是遇到 fatal error 。我没有在问题中包含一个例子)。我看不到错误。希望得到一些帮助。
我目前使用 g++ 作为编译器,还有其他选项:-D__int64=int64_t。
Java 类:
public class JNI {
public static native int test();
public static native int test1(int a);
public static void main(String[] args) {
String filename = "Path-to-lib\\libProjectJNI.dll";
System.load(filename);
//Prints 10 - every time - as expected
System.out.println(test1(5));
//Hangs, build fails, or fatal error every time.
System.out.println(test());
}
}
C++ 类:
#include "JNI.h"
#include <iostream>
#include <string>
JNIEXPORT jint JNICALL Java_project_JNI_test
(JNIEnv * env, jclass obj) {
std::cout << "PRINT THIS";
return 10;
}
JNIEXPORT jint JNICALL Java_project_JNI_test1
(JNIEnv *env, jclass obj, jint aint) {
return aint * 2;
}
C++ h:
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class project_JNI */
#ifndef _Included_project_JNI
#define _Included_project_JNI
#ifdef __cplusplus
extern "C" {
#endif
JNIEXPORT jint JNICALL Java_project_JNI_test
(JNIEnv *, jclass);
JNIEXPORT jint JNICALL Java_project_JNI_test1
(JNIEnv *, jclass, jint);
#ifdef __cplusplus
}
#endif
#endif
构建时出现的错误:
\nbproject\build-impl.xml:1051: The following error occurred while executing this line:
\nbproject\build-impl.xml:805: Java returned: -1073741819
BUILD FAILED (total time: 0 seconds)
hs_err_pid### 日志
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (0x20474343), pid=33944, tid=3260
#
# JRE version: Java(TM) SE Runtime Environment (8.0_60-b27) (build 1.8.0_60-b27)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.60-b23 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [KERNELBASE.dll+0x71f28]
#
# 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 (0x0000000002260800): JavaThread "main" [_thread_in_native, id=3260, stack(0x0000000002110000,0x0000000002210000)]
siginfo: ExceptionCode=0x20474343, ExceptionInformation=0x0000000600000070
Registers:
RAX=0x0000000000000000, RBX=0x0000000600000070, RCX=0x0000000000000000, RDX=0x0000000000000000
RSP=0x000000000220f460, RBP=0x000000000220f730, RSI=0x00000003fefac4f0, RDI=0x00000006000000b0
R8 =0x0000000000000000, R9 =0x0000000000000000, R10=0x0000000000000000, R11=0x0000000000000000
R12=0x0000000000000000, R13=0x000000000000000a, R14=0x000000000220f670, R15=0x00000005696e3030
RIP=0x00007ffb434f1f28, EFLAGS=0x0000000000000206
Top of Stack: (sp=0x000000000220f460)
0x000000000220f460: 00000000ffffffff 0000000600000070
0x000000000220f470: 00000003fefac4f0 00000006000000b0
0x000000000220f480: 0000000020474343 0000000000000000
0x000000000220f490: 00007ffb434f1f28 0000000600000001
0x000000000220f4a0: 0000000600000070 000000000000000a
0x000000000220f4b0: 0000000600000300 00000001800ce32c
0x000000000220f4c0: 00000001801523c1 000000000220f480
0x000000000220f4d0: 00000003fefbfec0 0000000180156860
0x000000000220f4e0: 00000006000001e0 0000000000000001
0x000000000220f4f0: 00000000000000b0 000000000220f730
0x000000000220f500: 0000000000000000 0000000000000000
0x000000000220f510: 0000000000000008 00000003ffa4d5ea
0x000000000220f520: 000077d3bf56b135 00000003fefbfec0
0x000000000220f530: 000000000220f4e0 00000003ffa4cc97
0x000000000220f540: 00000006000000b0 00000003fefac4f0
0x000000000220f550: 00000003fefcbcd0 000000000220f730
Instructions: (pc=0x00007ffb434f1f28)
0x00007ffb434f1f08: 49 8b d1 44 0f 47 c0 44 89 44 24 38 49 c1 e0 03
0x00007ffb434f1f18: e8 27 b2 00 00 48 8d 4c 24 20 ff 15 c8 a7 05 00
0x00007ffb434f1f28: 48 8b 8c 24 c0 00 00 00 48 33 cc e8 98 7a 00 00
0x00007ffb434f1f38: 48 81 c4 d8 00 00 00 c3 83 64 24 38 00 eb d6 cc
Register to memory mapping:
RAX=0x0000000000000000 is an unknown value
RBX=0x0000000600000070 is an unknown value
RCX=0x0000000000000000 is an unknown value
RDX=0x0000000000000000 is an unknown value
RSP=0x000000000220f460 is pointing into the stack for thread: 0x0000000002260800
RBP=0x000000000220f730 is pointing into the stack for thread: 0x0000000002260800
RSI=0x00000003fefac4f0 is an unknown value
RDI=0x00000006000000b0 is an unknown value
R8 =0x0000000000000000 is an unknown value
R9 =0x0000000000000000 is an unknown value
R10=0x0000000000000000 is an unknown value
R11=0x0000000000000000 is an unknown value
R12=0x0000000000000000 is an unknown value
R13=0x000000000000000a is an unknown value
R14=0x000000000220f670 is pointing into the stack for thread: 0x0000000002260800
R15=0x00000005696e3030 is an unknown value
Stack: [0x0000000002110000,0x0000000002210000], sp=0x000000000220f460, free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [KERNELBASE.dll+0x71f28]
C [cyggcc_s-seh-1.dll+0xcc97]
C [cygstdc++-6.dll+0xba6d1]
C [cygstdc++-6.dll+0xb0a7f]
C [cygstdc++-6.dll+0xada61]
C [cygstdc++-6.dll+0xaff59]
C [cygstdc++-6.dll+0xb4ee7]
C [libProjectJNI.dll+0x10b3]
C 0x0000000002375e34
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j gol.s305089.JNI.test()I+0
j gol.s305089.JNI.main([Ljava/lang/String;)V+20
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x00000000187fc800 JavaThread "Service Thread" daemon [_thread_blocked, id=2792, stack(0x0000000018bd0000,0x0000000018cd0000)]
0x0000000016e97000 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=35452, stack(0x00000000186d0000,0x00000000187d0000)]
0x0000000016e8f800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=15496, stack(0x00000000185d0000,0x00000000186d0000)]
0x0000000016e8d800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=17716, stack(0x00000000184d0000,0x00000000185d0000)]
0x0000000016e8b000 JavaThread "Attach Listener" daemon [_thread_blocked, id=26948, stack(0x00000000183d0000,0x00000000184d0000)]
0x0000000016e89800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=9012, stack(0x00000000182d0000,0x00000000183d0000)]
0x0000000002356800 JavaThread "Finalizer" daemon [_thread_blocked, id=24532, stack(0x00000000180e0000,0x00000000181e0000)]
0x000000000234d800 JavaThread "Reference Handler" daemon [_thread_blocked, id=35052, stack(0x0000000017fe0000,0x00000000180e0000)]
=>0x0000000002260800 JavaThread "main" [_thread_in_native, id=3260, stack(0x0000000002110000,0x0000000002210000)]
Other Threads:
0x0000000016e58000 VMThread [stack: 0x0000000017ee0000,0x0000000017fe0000] [id=4028]
0x0000000018803000 WatcherThread [stack: 0x0000000018cd0000,0x0000000018dd0000] [id=7356]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap:
PSYoungGen total 38400K, used 1996K [0x00000000d5f00000, 0x00000000d8980000, 0x0000000100000000)
eden space 33280K, 6% used [0x00000000d5f00000,0x00000000d60f33f8,0x00000000d7f80000)
from space 5120K, 0% used [0x00000000d8480000,0x00000000d8480000,0x00000000d8980000)
to space 5120K, 0% used [0x00000000d7f80000,0x00000000d7f80000,0x00000000d8480000)
ParOldGen total 87552K, used 0K [0x0000000081c00000, 0x0000000087180000, 0x00000000d5f00000)
object space 87552K, 0% used [0x0000000081c00000,0x0000000081c00000,0x0000000087180000)
Metaspace used 2783K, capacity 4486K, committed 4864K, reserved 1056768K
class space used 302K, capacity 386K, committed 512K, reserved 1048576K
Card table byte_map: [0x0000000011720000,0x0000000011b20000] byte_map_base: 0x0000000011312000
Marking Bits: (ParMarkBitMap*) 0x0000000070aca5b0
Begin Bits: [0x00000000121d0000, 0x0000000014160000)
End Bits: [0x0000000014160000, 0x00000000160f0000)
Polling page: 0x0000000000910000
CodeCache: size=245760Kb used=1102Kb max_used=1102Kb free=244657Kb
bounds [0x0000000002360000, 0x00000000025d0000, 0x0000000011360000]
total_blobs=260 nmethods=26 adapters=148
compilation: enabled
Compilation events (10 events):
Event: 0.079 Thread 0x0000000016e97000 22 3 java.util.jar.Attributes$Name::isAlpha (30 bytes)
Event: 0.079 Thread 0x0000000016e97000 nmethod 22 0x000000000246fb50 code [0x000000000246fcc0, 0x000000000246fef0]
Event: 0.080 Thread 0x0000000016e97000 23 3 sun.misc.ASCIICaseInsensitiveComparator::toLower (16 bytes)
Event: 0.080 Thread 0x0000000016e97000 nmethod 23 0x0000000002472950 code [0x0000000002472ac0, 0x0000000002472d10]
Event: 0.080 Thread 0x0000000016e97000 24 3 sun.misc.ASCIICaseInsensitiveComparator::isUpper (18 bytes)
Event: 0.080 Thread 0x0000000016e97000 nmethod 24 0x0000000002472dd0 code [0x0000000002472f20, 0x00000000024730d0]
Event: 0.080 Thread 0x0000000016e97000 25 3 java.lang.String::getChars (62 bytes)
Event: 0.081 Thread 0x0000000016e97000 nmethod 25 0x0000000002473150 code [0x0000000002473300, 0x0000000002473738]
Event: 0.082 Thread 0x0000000016e97000 26 3 java.lang.System::getSecurityManager (4 bytes)
Event: 0.082 Thread 0x0000000016e97000 nmethod 26 0x0000000002473950 code [0x0000000002473aa0, 0x0000000002473bd0]
GC Heap History (0 events):
No events
Deoptimization events (0 events):
No events
Internal exceptions (2 events):
Event: 0.028 Thread 0x0000000002260800 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.defineClass(Ljava/lang/String;[BII)Ljava/lang/Class; name or signature does not match> (0x00000000d5f0da00) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u60\4407\hotspot\srÃö×O ?
Event: 0.028 Thread 0x0000000002260800 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.prefetchRead(Ljava/lang/Object;J)V name or signature does not match> (0x00000000d5f0dce8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u60\4407\hotspot\src\share\vm\prims\j
Events (10 events):
Event: 0.081 loading class java/security/UnresolvedPermission
Event: 0.082 loading class java/security/UnresolvedPermission done
Event: 0.082 loading class java/security/BasicPermissionCollection
Event: 0.082 loading class java/security/BasicPermissionCollection done
Event: 0.082 loading class sun/launcher/LauncherHelper$FXHelper
Event: 0.082 loading class sun/launcher/LauncherHelper$FXHelper done
Event: 0.082 loading class java/lang/Class$MethodArray
Event: 0.082 loading class java/lang/Class$MethodArray done
Event: 0.082 loading class java/lang/Void
Event: 0.082 loading class java/lang/Void done
Dynamic libraries:
0x00007ff69b060000 - 0x00007ff69b097000 C:\Program Files\Java\jdk1.8.0_60\jre\bin\java.exe
0x00007ffb465f0000 - 0x00007ffb467b1000 C:\WINDOWS\SYSTEM32\ntdll.dll
0x00007ffb45170000 - 0x00007ffb4521d000 C:\WINDOWS\system32\KERNEL32.DLL
0x00007ffb43480000 - 0x00007ffb43668000 C:\WINDOWS\system32\KERNELBASE.dll
0x00007ffb45850000 - 0x00007ffb458f7000 C:\WINDOWS\system32\ADVAPI32.dll
0x00007ffb452f0000 - 0x00007ffb4538d000 C:\WINDOWS\system32\msvcrt.dll
0x00007ffb45530000 - 0x00007ffb4558b000 C:\WINDOWS\system32\sechost.dll
0x00007ffb46020000 - 0x00007ffb4613c000 C:\WINDOWS\system32\RPCRT4.dll
0x00007ffb45e60000 - 0x00007ffb45fb6000 C:\WINDOWS\system32\USER32.dll
0x00007ffb45390000 - 0x00007ffb45516000 C:\WINDOWS\system32\GDI32.dll
0x00007ffb3e860000 - 0x00007ffb3ead4000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.10586.0_none_8c15ae12515e1c22\COMCTL32.dll
0x00007ffb45a20000 - 0x00007ffb45c9d000 C:\WINDOWS\system32\combase.dll
0x00007ffb43840000 - 0x00007ffb438aa000 C:\WINDOWS\system32\bcryptPrimitives.dll
0x00007ffb45fe0000 - 0x00007ffb4601b000 C:\WINDOWS\system32\IMM32.DLL
0x00000000726a0000 - 0x0000000072772000 C:\Program Files\Java\jdk1.8.0_60\jre\bin\msvcr100.dll
0x00000000702c0000 - 0x0000000070b49000 C:\Program Files\Java\jdk1.8.0_60\jre\bin\server\jvm.dll
0x00007ffb45520000 - 0x00007ffb45528000 C:\WINDOWS\system32\PSAPI.DLL
0x00007ffb40550000 - 0x00007ffb40573000 C:\WINDOWS\SYSTEM32\WINMM.dll
0x00007ffb37a00000 - 0x00007ffb37a09000 C:\WINDOWS\SYSTEM32\WSOCK32.dll
0x00007ffb412a0000 - 0x00007ffb412aa000 C:\WINDOWS\SYSTEM32\VERSION.dll
0x00007ffb459b0000 - 0x00007ffb45a1b000 C:\WINDOWS\system32\WS2_32.dll
0x00007ffb404f0000 - 0x00007ffb4051c000 C:\WINDOWS\SYSTEM32\WINMMBASE.dll
0x00007ffb42de0000 - 0x00007ffb42e23000 C:\WINDOWS\system32\cfgmgr32.dll
0x0000000072650000 - 0x000000007265f000 C:\Program Files\Java\jdk1.8.0_60\jre\bin\verify.dll
0x0000000072620000 - 0x0000000072649000 C:\Program Files\Java\jdk1.8.0_60\jre\bin\java.dll
0x0000000072600000 - 0x0000000072616000 C:\Program Files\Java\jdk1.8.0_60\jre\bin\zip.dll
0x00007ffb439f0000 - 0x00007ffb44f4c000 C:\WINDOWS\system32\SHELL32.dll
0x00007ffb42e30000 - 0x00007ffb43475000 C:\WINDOWS\system32\windows.storage.dll
0x00007ffb46140000 - 0x00007ffb46192000 C:\WINDOWS\system32\shlwapi.dll
0x00007ffb42c60000 - 0x00007ffb42c6f000 C:\WINDOWS\system32\kernel.appcore.dll
0x00007ffb42d20000 - 0x00007ffb42dd5000 C:\WINDOWS\system32\shcore.dll
0x00007ffb42c10000 - 0x00007ffb42c5b000 C:\WINDOWS\system32\powrprof.dll
0x00007ffb42c70000 - 0x00007ffb42c84000 C:\WINDOWS\system32\profapi.dll
0x00000005696e0000 - 0x0000000569704000 C:\Users\active-folder-jni\dist\Debug\Cygwin-Windows\libProjectJNI.dll
0x0000000180040000 - 0x0000000180640000 C:\cygwin64\bin\cygwin1.dll
0x00000003fef00000 - 0x00000003ff055000 C:\cygwin64\bin\cygstdc++-6.dll
0x00000003ffa40000 - 0x00000003ffa5a000 C:\cygwin64\bin\cyggcc_s-seh-1.dll
0x00007ffb2c030000 - 0x00007ffb2c1bc000 C:\WINDOWS\SYSTEM32\dbghelp.dll
VM Arguments:
jvm_args: -Dfile.encoding=UTF-8
java_command: gol.s305089.JNI
java_class_path (initial): C:\Users\active-folder-java-src\dist\Project.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\plugin.jar;C:\Users\active-folder-java-src\build\classes
Launcher Type: SUN_STANDARD
Environment Variables:
PATH=C:\Program Files (x86)\iis express\PHP\v5.3;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;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\Microsoft\Web Platform Installer\;C:\Program Files\MATLAB\R2015b\runtime\win64;C:\Program Files\MATLAB\R2015b\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\;C:\cygwin64\bin;C:\Program Files\Java\jdk1.8.0_60\bin
USERNAME=myUsername
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows 10.0 , 64 bit Build 10586 (10.0.10586.0)
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 8268824k(3297764k free), swap 9579544k(2510856k free)
vm_info: Java HotSpot(TM) 64-Bit Server VM (25.60-b23) for windows-amd64 JRE (1.8.0_60-b27), built on Aug 4 2015 11:06:27 by "java_re" with MS VC++ 10.0 (VS2010)
time: Sat Apr 30 21:52:33 2016
elapsed time: 0 seconds (0d 0h 0m 0s)
最佳答案
是否像 C++ 端给出一个 8 字节整数地址一样简单,但 Java 认为您接收到的 int 类型是一个 4 字节整数?
Java 8 SDK 注释说 int 是 32 位。 https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html
由于您从 C++ 返回一个(可能是 64 位)整数,然后 Java 将其“转换”为 32 位类型。尝试将 Java 端的返回类型更改为 long 并查看它是否有效。
public static native long test1(int a);
此外,为什么不尝试以下操作,看看您是否可以判断崩溃发生的位置?
long n = test1(5); // get the value into a 64 bit int
System.out.format("%d%n", n); // print it separately
关于java - 带有 C++ 的 JNI 在 cout、printf 和方法调用上不断崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36959657/
我刚开始使用 JNI,但遇到以下问题。 我有一个包含简单类的 C++ 库。我从 Java Android 项目中调用了三个 JNI 方法,分别实例化所述类、调用实例化类的方法并销毁它。我保留了对该对象
背景 我有一个 android 项目,它使用 JNI(使用 NDK)以 Java 和 C/C++ 进行编码。 我在java端创建了一个Jni java包装器,它将自己完成所有Jni操作,而除了这个包装
我想传递一个java对象的地址,JNI方法应该填充所传递对象的字段。1. java代码传递给定的对象引用。 JNI 方法应该能够缓存这个对象。这是一次性通话。2. 然后,java 对象使用不同的参数重
我本质上是在尝试遵循描述的 SO 解决方案 here , 但我遇到了问题。 这基本上就是我在 JNI 库中所做的事情: handle = dlopen("/data/data/lib/my.packa
我试图实现某种异常处理 一开始我打电话 jni::ExceptionDescribe() 之后我使用了的实现 How to obtain a description of a Java excepti
是否可以从不同 jni 库的另一个方法调用 1 个库的 jni 方法?例如:我有 2 个库 lib_1.so 和 lib_2.so。 我想从 lib_2.so 调用 lib_1.so 的方法 get_
我想在native方法中使用动态注册,所以我需要设置JNI_onLoad功能。我只是写了一个函数来获取两个数字的总和。但是,它无法正确构建。我该如何更正错误? 这是我的 *.cpp 文件,我将此文件命
我已经为 C 头文件制作了一个 make 文件,它工作正常,但是说 JNICALL 和 JNIEnv 存在语法错误,但我已经弄明白了这是因为头文件中的类型。 Image of the failure
我需要实现一个本地方法,比方说“public native void someFunc();”。我有两个库,libabc.so 和 libdef.so。 Java 使用 System.loadLibr
背景 我正在 eclipse 中为 android 开发一个应用程序,现在我遇到了一个问题,我需要你的帮助。所以我必须从 JAVA 应用程序调用用 C 编写的函数。但是在我编写代码的过程中,我有一些问
我正在使用 Android 上的 Java native 接口(interface)将当前 Activity 传递给 native 方法。但我没有使用类似 JNI 的函数名称来执行此操作。我正在手动注
我正在使用 JNI,我想知道是否可以通过 delegate 进行通信。 例如: Kotlin typealias MessageReceived = (msg: String) -> Unit ext
看来我对 JNI 的运气并不好。我正在等待我买的书到货,但现在是试错法。 我正在使用 JNI 来实现 Lua 求值器。 evaluatorNew() 只是创建一个新的 Evaluator() 对象,创
我有下面的代码,我想调用在同一个源文件中实现的函数,在本例中使用 C 语言: JNIEXPORT jstring JNICALL MyClass_get_1Uname__C (JNIEnv *env,
硬件手机和平板电脑内存太少,但 HAXM 工作正常? 我的基本问题是我的应用程序(很可能是我的 Java 应用程序加载的 JNI 动态库)太大。如果未使用硬件电话和模板调用 JNI 指令,Java 应
我正面临崩溃 JNI WARNING : 0x44f81e80 is not a valid JNI reference, in Ldalvik/system/NativeStart;. run()v
我移植了很多数学知识。我正在使用 over to c++ from java 并看到这样做有很大的性能提升,但我无法弄清楚要使用什么 jni 函数来摆脱我不再需要的变量。例如,我知道当您的 jni 方
我正在使用 JNI 调用一个静态 java 方法,该方法又创建一个 Swing JFrame 并显示它。代码相当简单,Java 代码独立运行(即 java StartAWT 做它应该做的事),而当使用
我正在尝试创建一个新线程,因此我将 VM 从我的方法初始化(从 Java 调用)传递到我的新线程。在线程中,我调用 AttachCurrentThread 并获取 JNIEnv* env。 稍后,我尝
我想知道是否有可能从java调用C++方法。 我非常希望能够从 java 读取内存进程。 我懂c++,但我想使用像java这样的更高级别,但仍然能够侵入进程内存。 有什么线索吗? []的 最佳答案 这
我是一名优秀的程序员,十分优秀!