Access c library w/o using JNI

I have a compiled shared library from vendor with no access to the source that is needed to interact with our Java code. I do have access to the library function definitions. Is there a way to utilize the "extern" functions from the compiled library with Java without having to write JNI that get compiled into the C library?
For example, a function in the library is defined as: int isDiskOpen(const char *) which takes the name of the disk, and tells whether it is open ( 1,or 0). I can't write and compile into it with a Java_DiskUtils_isDiskOpen(JNIEnv *env, jobject obj, jstring dskName) wrapper to the C function.
Is this possible?

I am sort of new to JNI, and previously, I have put
the wrapper in the same source as the "real" function,
and compiled it into one library. You are saying use
two libraries, one the original 3rd party lib, and the
other my own wrapper library? How do you write a
library to access another library?In the source you just include the third party header file and use the declarations it provides.
From this source you can create a shared library in the same way you have done before.
When you run the Java program you make sure both your wrapper shared library and your third party shared library are in your LD_LIBRARY_PATH.
>
I am also in Unix, not Windows.A minority developer then!

Similar Messages

  • HT1941 I have inadvertently changed a file permission setting. When opening Aperture I get the following; Aperture cannot access this library. To use this library make sure it's file permissions are set correctly. I am an old dude new to Mac OS. What up?

    I have inadvertently changed a file permission setting. When opening Aperture I get the following; "Aperture cannot access this library. To use this library make sure it's file permissions are set correctly". I am an old dude new to Mac OS. Looked in settings but have no idea how to allow file sharing to myself. I have been using Aperture actively for 6 weeks. I'm the only one using this Mac. What up?

    Back up all data now.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. You can demote it back to standard status when this step has been completed.
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Drag or copy — do not type — the following line into the Terminal window, then press return:
    sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:20 ~ $_ ; chmod -R -N ~ $_ 2> /dev/null
    Be sure to select the whole line by triple-clicking anywhere in it. You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. You don't need to post the warning. If you don’t have a login password, you’ll need to set one before you can run the command.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2
    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the OS X Utilities screen appears, select Utilities ▹ Terminal from the menu bar. A text window opens.
    In the Terminal window, type this:
    resetpassword
    That's one word with no spaces. Then press return. A Reset Password window opens. You’re not going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select  ▹ Restart from the menu bar.

  • Using a library (jcurses) that uses jni

    I'm having trouble uses the JCurses library. Here's what's happening:
    ls -Ajcurses.jar  .keepme  libjcurses.so  Test.java
    javac Test.java -classpath jcurses.jar
    ls -Ajcurses.jar  .keepme  libjcurses.so  Test.class  Test.java
    java Test -classpath jcurses.jarException in thread "main" java.lang.NoClassDefFoundError: jcurses/system/Toolkit
            at Test.main(Test.java:6)
    rm Test.class
    jar xvf jcurses.jar jcurses/...(no jar error outputs)...
    ls -Ajcurses/ jcurses.jar  .keepme  libjcurses.so  Test.java
    javac Test.java
    ls -Ajcurses/ jcurses.jar  .keepme  libjcurses.so  Test.class  Test.java
    java TestException in thread "main" java.lang.ExceptionInInitializerError
            at Test.main(Test.java:6)
    Caused by: java.lang.NullPointerException
            at jcurses.system.Toolkit.getLibraryPath(Toolkit.java:111)
            at jcurses.system.Toolkit.<clinit>(Toolkit.java:37)
            ... 1 moreWhy does running "java Test" the first time output something different than the second just because? Also, why isn't the second working?

    Ok I got it working now. I used
    >java -cp .:jcurses.jar TestThe part that was really confusing me was:
    >java -cp jcurses.jar Test
    Exception in thread "main" java.lang.NoClassDefFoundError: TestI forgot that the java command only includes the current directory in the classpath if none is specified. Thats why >java Test worked: it used the default classpath which consists of the current directory, and the class I was executing and the library I was using were both in the current directory, so java located them, but the library failed because its classes assume that they will be executed from a jar. The reason >java -cp jcurses.jar Test didn't work is because the current directory was no longer part of the classpath, so java couldn't find the Test class which was in the current directory.
    Thanks.

  • Error Message - "Aperture cannot access this library"

    I'm using OS 10.5.7 and Aperture 2.1.3. I recently had an error message pop-up when I try to start Aperture that says, "Aperture cannot access this library. To use this library, make sure its file permissions are set correctly." Unfortunately, I can't seem to open up my library. Any ideas how to fix this or what is wrong? Thanks

    Hello,
    attached I would like to report how the problem solved.
    1. I had 63 Minute Call to Apple Support and we are tring some things. Finally I Spend spend 1 day for testing.
    2. Testing procedure:
    A) I exported each project step by step
    B) Than I deleted all appr. 50 projects in Aperture Library.
    C) After that I Imported each project to Aperture back.
    Result: 2 Project was corrupted, one of it was going well after export/import procedure how ever but the second ones error was constant appearing if I try to import it. The project consisting of 512 jpg files in total appr. 500MB.
    The solution for this project:
    I moved this jpg´s to waste bin und imported it from waste bin to Aperture again into a new project. Than I tested it again(Export/import) and it was fine.
    For final check I delete my Aperture backup und start a new one.
    Than start a compleate restoring from that last backup.
    Every thing was fine, all project include albums or books are ok.
    The pictures in the corrupted project was not imported by Aperture, they was created on a PC system(XP). Maybe that was the reason for the problem.
    A friend sad, that windows use not the agreed standard for jpg´s.
    I don´t know. So I´m happy all my books are back that is imported for a wedding photographer.
    Have fun
    bernhard66

  • Accessing a library from a second computer (not simultanously)

    With Aperture 1.5, I used to be able to access a library in computer A from computer B through our Ethernet network.
    Now, when I try with Aperture 2, I get the following message: "Aperture cannot access this library. To use this library, make sure it is on local disk and file permissions are set correctly."
    Did I miss something?

    When you're dealing with data integrity, it's not really about how long you can push your luck. It's more about what the potential is for a complete disaster. Rarely, amongst databases, SQLite (which is what Aperture uses) has *no recovery code* built into it - I know because I use it too. If you lose a single byte's worth of integrity, you are completely and utterly dead. Restore from a backup, if you have one. On a local disk, this is taken care of by flushing disk-writes all the way through to the disk platters. That's not available over a network filesystem.
    With that in mind, I can easily see the argument going along the lines of "disk is cheap, losing a photographer's entire library through no fault of ours is a disaster, let's turn off the network option".
    As a bonus side-effect, it'd stop people trying to share access to a single library at the same time (I know that's not what you were doing, but I'm sure others have tried). That would screw up a library PDQ - CoreData (which, given the schema, seems to be what Aperture uses) doesn't support that at all.
    From the text of that dialogue (the inclusion of the 'local' word), it seems clear to me that networked access to libraries is no longer supported.
    -=C=-
    Message was edited by: Complete Newbie

  • Error while accessing a library using content and structure

    I have a library having document and folder inside it. When I open the library using content and structure I get an error with a correlation ID. When checked the the logs with Correlation ID got an error message "View 'All Document' does not exist."
    'All Document' is name of default view on the library.
    When I open the library from view all site content the library is being opened.
    Please help!!!

    Hello Victoria,
    Thanks for  the response.
    I have tried troubleshooting steps given by you. 
    Check if the issue occurs with other users. Use another user to access the library in Content and Structure and then compare the results. --
    I tried with different users but no luck
    Make sure that the user account with issue has permission to view the All Documents view of the library. --
    Yes, user Account have the permission
    Check if the issue occurs with other libraries in the Content and Structure. If not, I recommend to save the library as
    a template including contents and then create a new library based on this template. After that use the new library instead of the old library. --
    No other library have this problem. I cannot save the library as template including the contents as the it has many folders and  files. The current size of library is 786 MB
    Clear cache in the browser or use another browser to see if the issue still occurs. --
    tries but issue persists.
    Best regards,
    Ratnesh

  • My tower for my dell computer died.got one from a friend with an existing itunes account. now I am unable to access my library and playlists, but can get to previous ownwer's.I downloaded itunes again using my apple id but was unsuccessful.HELP PLEASE!

    My Dell tower died.  Got one from a friend and am only able to get her account for itunes to appear.  I am unable to access my library even after downloading new using my apple id.  I can access songs I've purchased, but not ones that I downloaded from cds.  PLEASE HELP ME.

    Thank you for using the Apple Support Communities
    From what I understand is that the device will show up in iTunes but it will not allow you to synchronize media over to the device even after you reset the device. When you say you reset the device, do you mean you restored the device in iTunes? What error message you are getting when attempting to synchronize media?

  • How can I access revisions of a document using OpenXML sdk library?

    How can I access revisions of a document using OpenXML sdk library?
    Thanks in advance.
    Regards,
    Akanksha.

    Hi Akanska
    The following articles should give you a basic understanding of how to work with Revisions:
    https://msdn.microsoft.com/en-us/library/office/cc536011.aspx
    https://msdn.microsoft.com/en-us/library/ee836138%28v=office.12%29.aspx?f=255&MSPPError=-2147217396
    http://blogs.msdn.com/b/ericwhite/archive/2009/09/28/source-code-available-complete-implementation-of-accept-all-changes-tracked-revisions-in-open-xml-documents.aspx
    Cindy Meister, VSTO/Word MVP,
    my blog

  • Can access c++ library from flash action script by using SWC lib?

    We want to develope a Flash application based on Windows CE 6.0 R3. The application aims to communicate with middleware libraries written in C/C++. Is it possible to create SWC file using the c++ library file so that we can load this as a component in fla project for accessing the library functions from flash action script 3.0? OR Is there any simple way to access c++ library from action script?
    Thanks,
    Saumini

    I don't think Alchemy will help you.  The reason is Alchemy does not give socket capabilities beyond what Flash provides.

  • I cannot open a photo library from an external hard rive  I get a message that says: You have made changes to your iPhoto library using a newer version of iPhoto.  How do I access this library?

    I cannot open a photo library from an external hard rive  I get a message that says: You have made changes to your iPhoto library using a newer version of iPhoto.  How do I access this library?

    and
    and have you opened this library with any other computer?
    LN

  • Accessing VB Code using JNI

    Can access functions implemented in Visual Basic from a Java program using JNI?
    I was thinking like, since there's no .h file concept in VB, we can't access VB code from Java. Correct me if i am wrong....
    Thanks,
    Vasu

    As long as the VB app somehow exports its functions via the standard "C" interface (which is how all DLLs are exported), then you can call into it via JNI. I've successfully used JNI to call into a Delphi DLL, for example.
    The hard part is that VB doesn't want to do this by default, and to be honest, I'm not enough of a VB expert to tell you how you could do this. You can check your success, however, by running the dumpbin.exe utility (comes with MSVC) on the compiled DLL and see if your method shows up in some form. Once you know that name and how the parameters look (by-ref or by-val), you should be in good shape.
    I won't say it's an easy road to go, however--you may have more luck just hosting the VB code as an ActiveX control and connecting to it via the higher-level Java->COM APIs. Stu Halloway has a collection of such links on his home page: http://staff.develop.com/halloway.

  • I have macbook pro w existing iPhoto library. Now have Canon printer and loaded Canon software for same. Cannot access iPhoto library from Canon software, but prints fine from iPhoto. How can I use iPhoto library w Canon software?

    I have a macbook pro w exisitng iPhoto library. I now have Canon printer and loaded Canon software for same. I cannot access iPhoto library for use from Canon software. I can print from iPhoto directly to new printer without problem. How can I use iPhoto library with Canon software? I would like to try the software to see which I prefer...

    Simply export some photos from iPhoto to a folder on the desktop and experiment.
    Without telling us even what this program is, not to mind what it does, that's the best anyone can suggest.
    Regards
    TD

  • TS2972 my apple tv devices and other apple devices can access my library but using my library, i cant access any of the apple tv devices through airplay

    my apple tv devices and other apple devices can access my library but using my library, i cant access any of the apple tv devices through airplay

    Home sharing isn't working either
    Which is why you can not use the remote app.  Did you turn on home sharing on your computer and on ATV?
    eve though they have the same Apple ID.
    Did you enter the ApplieID in the home sharing login though?  Or just in for the iTunes store, or iCloud, or photo sharing, or something else?
    Home sharing isn't working either, I can't play or transmit any video from my iPad to the Apple TV because it doesn't recognize it
    That would be AirPlay, not homesharing.  THey are not related.  Did you enable air play on all the devices?
    Have you run the network test tools on ATV?  Can ATV access the iTunes store, Netflix, etc?

  • Can I access BIOS using JNI?

    Hi,
    Can I access BIOS using JNI on Windows and Linux platforms?
    Mathew

    I guess that the old BIOS functions (INT 15 for instance) are "emulated" by Windows when you are running old 16-bit DOS programs. They're mapped into equivalent Windows calls. Even if the BIOS implement different features you can't run the exact BIOS code. (Please correct me if I'm wrong)
    I don't know about Linux handling of BIOS calls.
    If you simply want to read (not execute) the BIOS code in Linux you can use a special device (/dev/kmem? I can't remember the exact name) and seek to the BIOS address.

  • Aperture cannot access this library" followed by "To use this library, make sure its file permissions are set correctly."

    Hi,
    I am completely confused. I use aperture everyday and today when I tried to open it I got the following message " aperture cannot access this library" then it said to use this library , make sure its file permissions are set correctly"
    So i read a bunch of posts and opened aperture while holding down option and command and repaired the file permissions.  it did nothing, when I tried to open aperture I received the same message.   So then i tried opening it while holding down just the option key. This brought up all of my libraries but when I chose the library i use daily the same message came up.
    Does anyone know how to fix this and/ or why it is happening?
    Thank you

    No idea how to check the format, not familiar with Drobo products. Does the drive show up in Disk Utility? If so you should be able to see how it is formatted there.
    How long has this setup been in use?
    Aperture libraries have to be on locally connected drives formatted as OS Extended as per Apple (see Format external drives to Mac OS Extended before using with Aperture for example). While Aperture may work with other setups there is always the possibility that the library will become unusable at any point in time with no warning.
    Try to find out the format of the drive and post back. Maybe something can be done but from the error messages you are getting I'm thinking the best course of action will be to restore from backups onto a correctly formatted drive.
    regards

Maybe you are looking for