native

Attach native application via JNI to already running JVM on Linux

限于喜欢 提交于 2019-12-12 12:13:19
问题 A similar question has already been answered for Windows, but I could not find out how to achieve the same on Linux. I want to deepen my knowledge in JNI. I already got JNI projects working with JNI_CreateJavaVM, creating a new JVM from within the native application. But this time I would like to not create the JVM within the native application (i.e., not using JNI_CreateJavaVM), but to attach to an already running one (i.e., using AttachCurrentThread on a VM that has been started before the

I receive error message when run JNI android app A/libc﹕ Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 17729

左心房为你撑大大i 提交于 2019-12-12 11:13:58
问题 I got an error when i run android app that I use JNI functions and c++ code in it. When it run, I got below message: Fatal signal 11 (SIGSEGV) at 0xe480001d (code=1), thread 5465 And finally here is my codes: JNIEXPORT jstring JNICALL Java_ir_bassir_ndktest4_MainActivity_getName (JNIEnv *env, jobject obj){ jclass cls = (*env)->GetObjectClass(env, obj); jmethodID mid = (*env)->GetStaticMethodID(env, cls, "testJava", "([Ljava/lang/String)[Ljava/lang/String"); jstring plainText = (*env)-

Add native library to local jar in gradle build

依然范特西╮ 提交于 2019-12-12 10:09:35
问题 I am desperately trying to build an opencv-based gradle project but so far I have not been able to make it run successfully. In this regard, I need to add a native library for the opencv-jar. I compiled the local jar with compile files('libs/opencv/mac/opencv-320.jar') but always get the following exception: Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java320 in java.library.path Of course it is because I did not add the libopencv_java320.dylib on mac / .dll on

Field's value of native query in JPA

最后都变了- 提交于 2019-12-12 09:32:10
问题 How to get value of some fields in a native query (JPA)? For example I want to get name and age of customer table: Query q = em.createNativeQuery("SELECT name,age FROM customer WHERE id=..."); Note: I don't want to map results to entities. I just want to get the value of the field. Thanks 回答1: A native query with multiple select expressions returns an Object[] (or List<Object[]> ). From the specification: 3.6.1 Query Interface ... The elements of the result of a Java Persistence query whose

Node.js native module is not a valid Win32 application error

谁说我不能喝 提交于 2019-12-12 08:19:54
问题 Trying to make Hello World native module for node.js Got an Win32 Project in VS 2012 with one file: #include <node.h> #include <v8.h> using namespace v8; Handle<Value> Method(const Arguments& args) { HandleScope scope; return scope.Close(String::New("world")); } void init(Handle<Object> target) { target->Set(String::NewSymbol("hello"), FunctionTemplate::New(Method)->GetFunction()); } NODE_MODULE(hello, init) That`s compiles to hello.node. Options: - Dynamic Library (.dll) - No Common Language

Native alternative for readlink on Windows

最后都变了- 提交于 2019-12-12 07:57:40
问题 Windows native alternative for ln -s is mklink . Is there any native alternative for readlink ? Or how to natively identify if the file is symlink? 回答1: I don't believe there's any tool directly equivalent to readlink . But you can see in the output of dir whether an item is a symlink or not, so you can still determine this from the command line or in a script. Test whether it's a symlink or not You can pretty easily test whether a given file is a symlink using syntax like: dir mysymlink |

Android native crash

和自甴很熟 提交于 2019-12-12 07:44:04
问题 We are not using any native code, as well our app doesn't have any native transitive dependency. After recent release (we updated couple fo dependencies and add new) we started seeing crashes like this in Google Play: native: pc 000000000006a548 /system/lib64/libc.so (tgkill+8) native: pc 0000000000067cd8 /system/lib64/libc.so (pthread_kill+68) native: pc 0000000000024b78 /system/lib64/libc.so (raise+28) native: pc 000000000001f318 /system/lib64/libc.so (abort+60) native: pc 000000000043471c

widget_service_trigger_update() return WIDGET_ERROR_PERMISSION_DENIED error

烈酒焚心 提交于 2019-12-12 06:49:21
问题 I'm developing native widget application in Tizen. I want to update a widget application from UI application. So, I find widget_service_trigger_update() API to update native widget. But widget_service_trigger_update() return WIDGET_ERROR_PERMISSION_DENIED error. Tell me what I did something wrong please. 回答1: I found out a something important. The widget application and UI application should be packaged together. When UI application which are not packaged with widget application use widget

Wlan SSID in java/c++

自古美人都是妖i 提交于 2019-12-12 06:06:49
问题 Is there any way i can get WLAN information f.e. SSID, Signal strength etc in java or C++? I know about the wlanscan function in C++. Can anyone give me any example on how to implement it? There is also a jwlanscan api for java but its not working for me. OS: Windows 7 Any help would be appreciated. Thanks! EDIT: { System.loadLibrary("wireless"); } List list = getNetworkAdapterInfo(); if (list == null) System.out.println("None Network Adapter."); else for (Iterator ite = list.iterator(); ite

Hibernate: How does native identifier generation strategy work

被刻印的时光 ゝ 提交于 2019-12-12 04:46:17
问题 Hibernate has an identifier generation strategy called native that selects identity , sequence or hilo depending upon the capabilities of the underlying database. I used MySQL with hibernate.hbm2ddl.auto=update which generated id BIGINT(20) NOT NULL AUTO_INCREMENT for id property of Long Java data type. I am trying to understand how did Hibernate choose AUTO_INCREMENT when it used SchemaExport tool. Is AUTO_INCREMENT the default primary key generation strategy for MySQL? Could somebody help