If my native method depends on other dll, how and where should place them?

I write a native method called A, and A needs to call some funciton in b.dll, c.dll,
then I generate the dll for A, and load in the java code, but how should I deal with b and c.dll
thanks

according to what you say, i just need to put the dlls which the native method depend on to the you mentioned location,right?
I tried but failed.
can you give me more idea?

Similar Messages

  • My songs skip when i have other programs running and am navigating through them, how do I fix this?

    My songs skip when I have multiple windows running and am navigating through them, it is quite irratating!

    First try deleting the songs and redownloading them
    Downloading past purchases from the App Store, iBookstore, and iTunes Store         
    Next
    - Reset the iOS device. Nothing will be lost      
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync/delete all music and resync
    To delete all music go to Settings>General>Usage>Storage>Music>Tap edit in upper right and then tap the minus sign by All Music
    - Reset all settings                 
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                               
    iOS: Back up and restore your iOS device with iCloud or iTunes
    - Restore to factory settings/new iOS device.                       

  • When I click on Firefox.exe I get error message Can't start Firefox.exe as js3250.dll missing. When I try to re-download Firefox I get message saying can't download because Firefox is already running, but it isn't. How and where can I get js3250.dll?

    Why punish me for a few too many keystrokes by deleting what I have already entered below my question. You're becoming MS.

    See these posts about the same problem:
    *[/questions/798251]
    *[/questions/823473]

  • Create MVC Framework UI to load others MVC application and those should display their view in Framework UI Layout and work independently

    Hi,
    How it is possible to develop a UI Framework/ MVC UI Framework which will loads the others MVC Application. The Framework will show the views of loaded MVC app into UI Framework view. At the same time the Framework UI will show the default view of each loaded
    MVC app(Module). If user click on any MVC Module on the UI then that MVC module should update itself by calling its own controller and others MVC app view should not disturb due to this operation. The UI Framework layout need to facilitate somehow to show
    the default view of each MVC somehow in different DIV. All MVC App will work independently and having communication with UI Framework only. HTML5, CSS3 and MVC 5 can be used
    Can anyone please suggest how to proceed on this?

    That's a strange request, but anyway, the MVC section is at the link below,
    http://forums.asp.net/1146.aspx/1?MVC

  • HT1338 I HAVE INSTALLED MORE MEMORY IE FROM 4GB TO 16GB AND I HAVE LOST MY FINAL CUT PRO X AND OTHER PROGRAMES HOW CAN I DOWN LOAD THEM AGAIN

    I HAVE INSTALLED MORE MEMORY ON MY iMAC IE FROM 4GB TO 16GB BUT I HAVE LOST ALL MY FINAL CUT PRO X EDITING SOFTWERE ECT HOW DO I RE-INSTAL IT ALL

    Hi John,
    No reason that should happen!???
    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair Disk, (not Repair Permissions). Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)
    If perchance you can't find your install Disc, or are running 10.7+, at least try it from the Safe Boot part onward.
    If 10.7.0 or later...
    Bootup holding CMD+r, or the Option/alt key to boot from the Restore partitiion & use Disk Utility from there.

  • Unable to call a native method

    Hi All,
    I am trying to call a native method tapi3Init from tapi3.dll present in Windows\System32 folder. But I get an error as below.
    Exception in thread "Main Thread" java.lang.UnsatisfiedLinkError: DLLCall.tapi3Init
         at DLLCall.main(DLLCall.java:25)
    I have verified my java.library.path and it has the path in it. I have cross verified by typing a wrong dll name and that gave a relevant error. So, please let me know what is going wrong?
    Also, is it not possible to call a native method from a dll which is not formed by using the javah header file?
    Thanks.

    native method tapi3Init from tapi3.dllSo that would be your JNI method.
    Exception in thread "Main Thread" java.lang.UnsatisfiedLinkError: DLLCall.tapi3Init And you are not calling it. Standard reasons apply.
    - library not loaded
    - Signatures are different.

  • Same method name in different DLLs

    I have two C++ files, "File1.dll" and "File2.dll". Both contain the implementation of a native method. The signature (name, arguments and return types) for each native method are identical, however, the code itself for each method is very different. For simplicity, assume both method are called runmethod(...).
    Firstly I want to run the native method runmethod(...) contained in "File1.dll", and then a few lines of code later I want to run native method runmethod(...) in "File2.dll" .
    I do a System.loadLibrary("File1.dll") and call runmethod(...) with no problems. However, my problem starts when I then do a System.loadLibrary("File2.dll") and call runmethod(...) again. Unfortunately, this runs runmethod(...) in "File1.dll"
    Is there any way I can, when invoking a native method, force it to use a particular dll in cases where there is a name clash.
    (Changing the C++ source code is not an option BTW. Unloading the first DLL would be ideal but I understand from looking at other threads this cannot be done. )
    Many thanks in advance
    David.

    You have to dynamically load the second dll and create the method pointers yourself. This is somewhat akin to reflection in java. Note that doing this means that all of the methods have to be called that way (although you might be able to load it twice.)

  • How to Provide Native Methods in an Executable?

    Hey there,
    I'm writing a native Java launcher as a replacement for java.exe (or eclipse.exe). So far I'm only on Windows NT x64. Things work pretty well: My native executable launches the JVM using the Invocation API and calls a static `main' method.
    Now I thought it was a good idea if my executable could provide the implementations of a few native methods so the `jvm.dll' can communicate with the executable that it was loaded by. This would free me from having to locate and load a shared library at runtime. I expected this to "just work," but alas, it didn't. Providing a simple native method such as
    JNIEXPORT jboolean JNICALL
    Java_com_phrood_kourou_Kourou_available0(JNIEnv* env, jclass cls) {
    return JNI_TRUE;
    in the executable and calling it from Java through JNI, I get an `UnsatisfiedLinkError'. Why is that so? Both the executable and the DLL live in the same process, so shouldn't the C function be found without further concern?
    Then I came up with the somewhat experimental idea and just loaded the EXE file from Java by `System.load(pathToExe)'. I never expected this to work, but---it did!
    That's good news, of course. Only I'm afraid that's a lot more memory-consuming than it needs to be. My EXE file has some 200 KB and counting, and I only need I a handful of small native-method implementations. I could write a DLL, of course, but I'd like to do without an extra file and an extra project to set up and maintain.
    So, my question is: Why do I have to load the EXE into the same process a second time? Is there a more elegant solution?
    Regards,
    -- Phil

    It doesn't work anyway. Although I can load my EXE as a DLL, the newly-loaded image has its own address space, so I cannot use that to call back the EXE.
    I think I can acomplish what I need without a DLL altogether. Hopefully.
    I want the usage of my executable to be as simple as using `java.exe'. Clients should just write a configuration file, rename and start or double-click the EXE and that's it. An MSI would be pointless here, since the usage of the launcher is completely generic.
    More importantly, maintaining cross-platforms C++ projects with Eclipse CDT is possible but a bit of a hassle. I already have two projects: one for the EXE and one for the Java companion Jar. Creating a new DLL project would require me to maintain 3 Eclipse build configurations for Windows, Linux, and Mac; and even another three should I support the x86 architecture. I'd be happy if I could do without.
    What strikes me is that you folks try to teach me what I should do or not do, even call my problem a "nonproblem," rather than just help me out and try to answer my questions. None of the answers here were helpful to me, but I think I figured it out.
    Nonetheless, thanks for taking the time to read and answer.

  • Loading library with dependencies (on other dll's)

    I have created a DLL with JNI in it.
    Several of the calls within this dll depend on other dll's.
    If I put all the dependent dll's in say System32 it runs fine, of if I put the folder containing all the dlls in the %PATH% it works.
    Are there any other options for this?
    Reason being if another developer wants to code in my project they will either need to move dlls to system32 or add the folder to their own PATH.

    avalanche333 wrote:
    jschell wrote:
    Are there any other options for this?The OS, not java, is what loads the shared libraries. You must meet the rules of the OS.
    And OSes, including windows, requires that it is the shared library path. Which is PATH on windows.
    The reason System32 works is because it is in PATH.
    Otherwise you must use load().Hmm, well I will add the dir to PATH then.
    Loading each files does not seem reasonable as there are soo many DLL's and I believe I have to load them in the proper order.Which of course is up to you. It is trivially simple to provide a config file with the names ordered in it and use that to drive a loader.
    >
    Only think I don't like about this is that it makes development a little more tedious. Anytime someone wants to use my library or test it they will need to first set the dir up in their path.Which anyone that is using a library should expect anyways or should get use to it in the first place.
    As a library developer you need do nothing more than tell the user what is required. It is nice to tell them all of the shared libraries and load order, but then why do you expect that most apps will not use an installer which deals with that?

  • How to incorporate .dll files and java

    i have one .dll file (that .dll file was not developed by me but i know which methods are there in that .dll file) then how to incorate that one

    What exactly do you mean by "how to incoporate" .dll file?
    I assume you want to call native methods defined in the .dll file in a java progam.
    If so, then this Java Native Interface (JNI) tutorials and code camps at http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html tells you how.
    Hope this helps.

  • Calling multiple DLL from Java and calling same native method

    i have two dll files named DLL_1.dll and DLL_2.dll .
    Both of them contain a native method which has a signature
    JNIEXPORT void JNICALL Java_Database_Notify
    (JNIEnv *, jclass);
    This method is common to both the DLL
    Now i load both of the DLL's using,
    System.loadLibrary("DLL_1");
    System.loadLibrary("DLL_2");
    Both of the DLL are loaded form same Java Application
    But the problem is that , whenever i try to call the Notify Method , it calls the Notify method of DLL_1 only.
    How do i call the Notify Methos of second DLL(i.e DLL_2).
    Is there any reference that i can get to all the DLL files when i load then , so that i can use that reference to invoke the Notify method of that particular DLL.

    i have two dll files named DLL_1.dll and DLL_2.dll .
    Both of them contain a native method which has a
    signature
    JNIEXPORT void JNICALL Java_Database_Notify
    (JNIEnv *, jclass);
    This method is common to both the DLL
    Now i load both of the DLL's using,
    System.loadLibrary("DLL_1");
    System.loadLibrary("DLL_2");
    Both of the DLL are loaded form same Java
    Application
    But the problem is that , whenever i try to call the
    Notify Method , it calls the Notify method of DLL_1
    only.
    How do i call the Notify Methos of second DLL(i.e
    DLL_2).
    Is there any reference that i can get to all the DLL
    files when i load then , so that i can use that
    reference to invoke the Notify method of that
    particular DLL.You need to explain exactly what you are trying to achieve.
    As per the description above it is impossible in java.
    And I didn't say JNI, I said java.
    Your above statement suggests that you think that you can have exactly the same java signature do two different things.
    Note again that I said java not JNI.
    A JNI method is just a tag that represents a java signature. Your description suggests that you are attempting to do it twice.
    There are three possibilities.
    1. Your explanation is incomplete.
    2. You are trying to do something that is impossible in java.
    3. You are trying to solve a problem and your description of your solution is not sufficient to determine what that is (and of course the solution is wrong.)

  • Call native methods from windows dll

    Hello all,
    I want to call BlockInput method from User32.dll. My source code looks something like this:
    public class User32Dll_1 {
         static {
              try {
                   System.loadLibrary("User32");
              catch (Exception ex)
                   ex.printStackTrace();
         public static void main(String[] args) throws UnsatisfiedLinkError {
              BlockInput (true);
         /** @param b
         * @dll.import("USER32")*/
         private static native boolean BlockInput(boolean bBOOL);
    And the problem is that I get the following exception:
    java.lang.UnsatisfiedLinkError: BlockInput
         at User32Dll_1.BlockInput(Native Method)
         at User32Dll_1.main(User32Dll_1.java:27)
    Exception in thread "main"
    Can someone provide me a solution for this?
    Thank you in advance!

    can't do
    use JACOB
    http://danadler.com/jacob/
    or
    http://www.ezjcom.com/

  • Access object attributes using other object JNI native method

    Hi. I'm trying to change an attribute of object O1 from another object O2 without invoking a O1 method and without making the attribute as public or protected.
    The only possibility that comes to my mind for doing so is writting a JNI native method
    public class O1 {
    static public native changeAttribute (Object O2, Object newAttributeValue) ;
    that change the attribute memory reference, but all I've found about accesing attributes in JNI is about accessing the invoker attributes (in this case, O1).
    �Does any one know if it's possible to do so? Thanks.

    I know that is not a good practice but I cannot figure out another way.
    I'll try to explain the whole problem so you see the reason. I'm working with transactions, using objects as the data. An object can be opened for write by several transactions because the granularity for conflicts is not the object, is each of its attributes. As long as two transaction don't write the same attribute, they both can write. For writing, each transactions uses a private copy of the object. At committing, the actual copy of the object must be replaced by the committer one, but as far as the granularity is the object attributes, only each written attribute must be replaced (if not, only the last commit would be visible).
    This attribute replace must be done by the transaction manager as far as the transactional object is provided by the client. So what i was thinking was to use JNI or some trick like that to replace the object attributes transparently to the object.
    I hope the explain is clear, my english is a little asleep :-(.
    How to do it with reflection? I thought that was only for method calling. Anyway, there wouldn't be problems if the attributes are private?
    Thanks for answering.
    EDIT: I've been able to change a public field using reflection, but not the private one
    import java.lang.reflect.*;
    class Caca {
    public static void main(String[] args) {
    Integer r = new Integer(0);
    System.out.println("original: " + r.toString());
    modifyWidth(r, 300);
    System.out.println("modified: " + r.toString());
    static void modifyWidth(Integer r, int newValue ) {
    Field valueField; Class c = r.getClass();
    try {
    valueField = c.getField("value");
    valueField.set(r, newValue);
    } catch (Exception e) { System.out.println(e); }
    Message was edited by:
    dfasdfsdafsadfasdf

  • Oracle.DataAccess dependency issue: whats the other dll?

    Hi
    My client programm complains that it cannot load the Oracle.DataAccess assembly but I the dll is within the execution/installation folder of the programm. Maybe I should mention that I removed Oracle.DataAccess from the Global Assembly Cache (because of ODT 11 and ODT 10 issues). When I did that, I remember that there were 2 dlls removed but I dont know the second one (which probably is the depending one).
    Can someone tell me the name of this dependency-dll and where to find it?
    Its kind of urgent :)
    Thanks in advance

    There's a lot of DLLs involved because ODP.NET relies on the Oracle client being installed as well.
    You can do it the hard way and download "depends.exe" (Dependency Checker) from a windows tools site, or you can just reinstall ODAC. It's probably easier and safer to just install ODAC.
    If you want to create a custom deployment, checkout the "XCopy" version of ODAC. It sort of sounds like that is what you are looking for.

  • UnsatisfiedLinkError,   Load Library Successfully, Native Method Not Found

    I am using JNI to call a ".dll" file I made on windows.
    I got the exception:
    Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: com.aspectgaming.core.io.JniInnocore.Dpci.waitEvent(Ljava/lang/Object;J)I
    at com.aspectgaming.core.io.JniInnocore.Dpci.waitEvent(Native Method)
    at com.aspectgaming.core.io.JniInnocore.IDLPThread.run(IDLPThread.java:19)
    at java.lang.Thread.run(Unknown Source)
    The code for loading c dll library:
    URL url = Thread.currentThread().getContextClassLoader().getResource("");
    String baseClassPath = url.getPath();
    System.load(baseClassPath "com/aspectgaming/libjnidpcicore.dll");+
    The  ".dll"  file is already loaded,  because when I changed the dll file name to any other ones,  a "library file not found" exception will be caught.
    The problem is Dpci.waitEvent and all the native methods could not be found.
    I used a PE viewer to view the dll exports I got:
    Export table
    Characteristics=0, TimeDateStamp=1237366066, MajorVersion=0, MinorVersion=0, Name=36994, Base=1, NumberOfFunctions=9, NumberOfNames=9, AddressOfFunctions=36904, AddressOfNames=36940, AddressOfNameOrdinals=36976,
    TimeDateStamp:Wed Mar 18 16:47:46 GMT+08:00 2009
    Java_com_aspectgaming_core_io_JniInnocore_Dpci_getEventName@12 (Ordinal: 1, Entry Point RVA: 147ah (5,242))
    Java_com_aspectgaming_core_io_JniInnocore_Dpci_getNumOfEvents@8 (Ordinal: 2, Entry Point RVA: 11a5h (4,517))
    Java_com_aspectgaming_core_io_JniInnocore_Dpci_getNumOfInputPorts@12 (Ordinal: 3, Entry Point RVA: 1789h (6,025))
    Java_com_aspectgaming_core_io_JniInnocore_Dpci_getSramSize@8 (Ordinal: 4, Entry Point RVA: 1190h (4,496))
    Java_com_aspectgaming_core_io_JniInnocore_Dpci_readEvent@12 (Ordinal: 5, Entry Point RVA: 11bah (4,538))
    Java_com_aspectgaming_core_io_JniInnocore_Dpci_readPort@12 (Ordinal: 6, Entry Point RVA: 17a7h (6,055))
    Java_com_aspectgaming_core_io_JniInnocore_Dpci_waitEvent@20 (Ordinal: 7, Entry Point RVA: 14b8h (5,304))
    Java_com_aspectgaming_core_io_JniInnocore_Dpci_waitIOPort@24 (Ordinal: 8, Entry Point RVA: 17dbh (6,107))
    Java_com_aspectgaming_core_io_JniInnocore_Dpci_writePort@16 (Ordinal: 9, Entry Point RVA: 182ch (6,188))
    The java class "Dpci" is exactly in this package : com.aspectgaming.core.io.JniInnocore;
    I compiled it by gcc on linux as a ".so" file and everything is working on linux.
    On windows I am compiling this by Mingw gcc.
    Here is the make file on Windows which is used by Mingw32-make:
    dpci_core:
    gcc -o ../../../java/com/aspectgaming/libjnidpcicore.dll -shared -IC:\jdk1.6.0_10\include -IC:\jdk1.6.0_10\include\win32 -I'D:\Program Files\Innocore Gaming Ltd\DirectPCI SDK & Run-time\include' dpci_core.c libdpci_static.lib
    dpci_core.c is my code file and  libdpci_static.lib is the library that my c dll will depend on.
    Any thought to this UnsatisfiedLinkError exception problem?
    Thanks!

    I recompile my codes under visual c++ 2008 express on Windows XP professional, and I have already got rid of this problem.
    But when I move the compiled java jar application to windows xp embedded edition, an exception will be caught:
    C:\AspectGamingCore>java -jar Aspect.jar
    Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\AspectGamingCore\l
    ib\libjnidpcicore.dll: This application has failed to start because the applicat
    ion configuration is incorrect. Reinstalling the application may fix this proble
    m
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.load0(Unknown Source)
    at java.lang.System.load(Unknown Source)
    at com.aspectgaming.core.io.JniInnocore.Dpci.loadLibraryOnWindows(Unknow
    n Source)
    at com.aspectgaming.core.io.JniInnocore.DpciTest.main(Unknown Source)
    I don't know if there is any compatible problem bewteen xp and xpe but one possible reason is that xpe may be lack of some dll files like msvcr90.dll.
    So I tried to compile the dll as static library in vc++2008, but this does not run even on my winxp professional:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\AspectGamingCore\l
    ib\libjnidpcicore.dll: %1 is not a valid Win32 application
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.load0(Unknown Source)
    at java.lang.System.load(Unknown Source)
    at com.aspectgaming.core.io.JniInnocore.Dpci.loadLibraryOnWindows(Unknow
    n Source)
    at com.aspectgaming.core.io.JniInnocore.DpciTest.main(Unknown Source)
    Could JNI call a c static library? Why it says "not a valid Win32 application"?

Maybe you are looking for