javaRelated issues-Collection of common programming errors
Liam W
java android eclipse android-ndk unsatisfiedlinkerror
I’ve been trying to figure out why I’m getting an error stating the method can’t be found, but everything seems to be in order (at least the things that would cause this error).My Android class:package com.liamw.root.androididchanger;import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView;public class DebugUserActivity extends Activity {Button button;TextView logcat;static {System.loadLibrary(“sqlite”);}@Overri
mj_
java ubuntu service daemon jsvc
I’m trying to create a service that will run in Ubuntu Linux written in Java. My executable Jar file is a big fat Jar file that has all the dependencies packaged inside with it. I get the following error when I try to run it using JSVC. Java VM created successfully Class org/apache/commons/daemon/support/DaemonLoader found Cannot register native methods java_init failed Service exit with a return value of 1What’s killing me is the “cannot register native methods” line. What does this mean and ho
user2907333
java android cordova
I’m making an android app which uses bluetooth using phonegap and I’m having issues handling code because it get’s called every 100ms. I want to try if the issue occurs because my phonegap javascript code is to long causing delays. To try this I want to dispaly the received message using a native textbox. Is this possible? and How would I do this?ThanksMartijn PS: I’ve tried using Toast but since I want to change the displayed value every 100ms this doesn’t work.Codeupon receiving a message this
Preetygeek
java c++ winforms jni
So, i have visual studio consloe project that compile to .dll file. I’ve created simple windows form System::Windows::Forms::FormI’ve created a .java file:import java.io.Serializable;public class MyBean implements Serializable{/*** */static{System.loadLibrary(“MyBean”); }private static final long serialVersionUID = 1L;private static native String getDateCpp();public String getDate(){return getDateCpp();}}compiled it and generate a .h file by javah:/* DO NOT EDIT THIS FILE – it is machine genera
Felix
java javassist
With Javassist, is there any way to inject code into a native method? In this case, I’m trying to make the OpenGL calls in my game print out their names and values when called, but all my attempts have hit errors when I assume the openGL dll code is added.The method would look something like:public static native void glEnable(int paramInt);Since the methods initially have no body, the only way I’ve found to actually add the code is with something like:CtBehavior method = cl.getDeclaredBehaviors(
Can Eldem
java eclipse leap-motion
I have a project that uses leap motion sdk. I wrote this project in Eclipse. When I run my program I don’t have any problem because I set my native libraries as it is suggested from configuration. However, when I export my application I can not run my program because Eclipse does not include my native libraries and I am having this error. Native code library failed to load. java.lang.UnsatisfiedLinkError: no LeapJava in java.library.pathMy purpose is create a .jar file which user can run with o
Arturs
java android upnp
From Android 4.1 (under Wi-Fi Direct service discovery) it is suppose to support native UPnP service discovery.I presume it was developed for Wi-Fi Direct, but the methods available seem to be generic. Even the JavaDoc for methods mention that it searches for all UPnP services on the network and not only WiFi Direct slaves/masters.However, I am failing to implement it so that it works… I manage to set up all requirements and I get positive onSuccess callbacks, but I receive no onUpnpServiceAva
TheEnemyOfQuality
java dll linker jni
I’ve got a bit of an odd problem. I have a project in C++ that’s basically a wrapper for a third party DLL like this:MyLibrary –loads DLL_A —-loads DLL_BI load DLL_A with LoadLibrary(), wrap several of its functions and generate my own DLL. I’ve tested this in a C++ project and a C# project. Both do everything they’re supposed to do: load DLL_A, make a couple of function calls, and indirectly load DLL_B. The problem is when I build a DLL for java and make the calls through JNI. Everything run
user614454
java android https
I am trying to make a HTTPS call using Java to a browser that uses the native login prompt.http://blog.stevensanderson.com/2008/08/25/using-the-browsers-native-login-prompt/Currently I’m using the below for HTTP and it works fine for other websites since I know the parameters to put in…however it fails for the above type of login (I am not sure how to capture the parameters…it’s a login pop up..or if this is even the correct approach)….any ideas??..thanksHttpUtility.sendPostRequest(request
Karel Petranek
java java-web-start java-native-interface
I am using Java Web Start to launch a Java application that depends on some third party native libraries. These native libraries then subsequently load another native library (commonLib) as their dependency using LoadLibrary/dlopen.When not using Web Start, everything works as expected when the native libraries are located in the same directory.Web Start, however, requires the native libraries to be packed in a jar file and referenced in the jnlp file, which I did:<!– Windows OS –><re
Web site is in building