Having trouble with including JNI library in netbeans

[Sorry a newbie question - I am more used to writing large amounts of Solaris kernel and writing a JNI for the first time]
Guys,
I have a C library that needs to hook into the Java bean. I created a JNI library wrapper around the C library using swig/javah
and that went fine (using some of the examples/ref in this forum). The JNI library contains classes like SysInfoJNI created
by swig.
class SysInfoJNI {
public final static native int NAME_LEN_get();
public final static native int NAME_LEN_set();
I quickly wrote a standalone test program where I did
public class test {
// Load JNI Library
static {
System.loadLibrary("SysInfo");
public static void main(String[] args) {
SysInfoJNI siJNI = new SysInfoJNI();
I can compile and run this on command line doing
javac *.java
java -Djava.library.path=./ Sysinfotest
and it all works fine. Now I move this code to netbeans since I need to add some more code
and create a java->web project and pretty much transfer the code there. I add the libSysinfo.so
using the property->library->create option but netbeans still can't see the symbols coming
out of Sysinfo JNI library. I suspect it wants the class definitions. My question is how do I
supply that? swig didn't really crate a header file but it did create Sysinfo.java file. Do I
just copy Sysinfo.java in the src directory (ugly?) or is there a convention of keeping the
*.java files in some standard place (like /usr/include for C headers) and then what would be
the method to include SysInfo.java to my netbeans src so that symbols can be found.
Thanks,
Sunay

OK, seems like I had some kind of mismatch between the library & classes.
The loadLibrary only had the name and I had the library in /usr/lib. After running
truss -f -t open /usr/tomcat6/bin/startup.sh >& tomcat.out
I could see the tomcat was finding the library but still reporting link error.
Recompiling the library and classes again and then placing the library
in /usr/lib and classes in the right directory resolved the issue.
So I guess the answer to my original question is that classes need to
be delivered as a jar along with the rest of the distribution while the
library can be delivered in /usr/lib as part of the system.
Appreciate the help and quick responses.
Sunay

Similar Messages

  • I am having trouble with the music library on an IPad air.

    Hi I foolishly synced an air to my second computer which does not hold all my music.  I have been unable to get it to sync to the main computer.  the message says there is not enough room, quite right! how do I get the music that is in place off the pad?

    RR,
    Not to worry, you're not the first to expect Print to finish by returning you to the edit mode. The thing is that Printing is so hit and miss with this version of the app, you will probably want to stay in the Print window for more than one attempt.
    Jerry

  • TS1468 I am having trouble with two cover flows duplicating themselves more than once, is there anyone out there that can help me with this, they are not duplicated in my itunes library, just the ipod.

    I am having trouble with two cover flows on my IPOD, duplicating themselves more than once, they haven't duplicated themselves in my Itunes library, just the ipod, could anyone have any ideas on how I could fix this problem. I have tried so many times, even if I restore the ipod, it still does the same thing. Please if possible email me at [email protected] with any suggestions.

    Aha! I have sorted it.
    For those with similar problems, the solution is this:
    Macintosh HD > Library > Audio > MIDI Drivers
    Then delete DigiDioMidiDriver.plugin

  • Having trouble with pop-up windows and ads for MacKeeper

    I've been having trouble with pop-up windows and ads for MacKeeper and similar "services." Tried to download "MPlayerX" a week ago and it all started then. I thought I deleted the file but I'm still having trouble. I've been digging for solutions on here, but nothing I've found on here has worked yet--the VSearch stuff (I think) isn't on my hard drive. Any advice?

    You installed a variant of the "VSearch" trojan. Remove it as follows.
    This malware has many variants. Anyone else finding this comment should not expect it to be applicable.
    Back up all data before proceeding.
    Triple-click anywhere in the line below on this page to select it:
    /Library/LaunchAgents/com.venus.agent.plist
    Right-click or control-click the line and select
              Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.* A folder should open with an item selected. Drag the selected item to the Trash. You may be prompted for your administrator login password.
    Repeat with each of these lines:
    /Library/LaunchDaemons/com.venus.daemon.plist
    /Library/LaunchDaemons/com.venus.helper.plist
    Restart the computer and empty the Trash. Then delete the following items in the same way:
    /Library/Application Support/venus
    /System/Library/Frameworks/v.framework
    The problem may have started when you downloaded and ran an application called "MPlayerX." That's the name of a legitimate free movie player, but the name is also used fraudulently to distribute VSearch. If there is an item with that name in the Applications folder, delete it, and if you wish, replace it with the genuine article from mplayerx.org.
    This trojan is often found on illegal websites that traffic in pirated content such as movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect more of the same, and worse, to follow. Never install any software that you downloaded from a bittorrent, or that was downloaded by someone else from an unknown source.
    In the Security & Privacy pane of System Preferences, select the General tab. The radio button marked Anywhere  should not be selected. If it is, click the lock icon to unlock the settings, then select one of the other buttons. After that, don't ignore a warning that you are about to run or install an application from an unknown developer.
    Then, still in System Preferences, open the App Store or Software Update pane and check the box marked
              Install system data files and security updates (OS X 10.10 or later)
    or
              Download updates automatically (OS X 10.9 or earlier)
    if it's not already checked.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • I am having trouble with my Mac Mini's ethernet connection.   Defining a new network interface shows no ethernet adaptor.  Reloading SL from DVD repaired.  But SL update lost ethernet again.  Will Lion Fix?

    I am having trouble with my mac mini ethernet.  It had been working for weeks after an update to SL 10.6.8.
    Once it went out and i repaired it by defining a new connection from System Preferences ->Network->(left panel service, +).
    But yesterday, after a power up.  my ethernet was not working again. I tried this old trick to repair it, but the interface choices
    listed for '+' a new service did not include Ethernet any more.  And the Utilities->System Profiler->Ethernet Cards shows
    no ethernet available.
    As a last ditch effort i reloaded my original SL from DVD.  (I think it was version 10.6.4 but i could be mistaken on the version).
    The ethernet worked!  But KeyNote wasn't going to work because apparently the version i purchased depends on 10.6.8.
    So I upgraded again to SL 10.6.8 (Plus some other updates like AirPort which i don't use).
    Now the Ethernet is not working again.  I see the same symptoms as before with the Ethernet seeming not installed.
    Is this a problem seen by others?
    Would going to Lion fix the problem?
    Could AirPort actually be the culprit and not SL?
    If i stay with my original SL, would i need to repurchase a version of KeyNote for the older version of SL?

    Have you reset the SMC?
    Shut down the computer.
    Unplug the computer's power cord.
    Wait fifteen seconds.
    Attach the computer's power cord.
    Wait five seconds, then press the power button to turn on the computer.
    While you're at it, resetting the PRAM won't hurt anything and 'might' help is SMC reset didn't work (PRAM does some port control):
    Shut down the computer.
    Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.
    Something else you might try .... you don't say how you're updating to 10.6.8, however, if you're using Software Update, you might try downloading the 10.6.8 combo update, which contains all updates to 10.6. Sometimes, Software Update doesn't work quite right, and installing the combo update fixes that. Download the update from Apple's download site at http://support.apple.com/downloads/ , using Disk Utility repair permissions, apply the combo update, then repair permissions again.

  • Having trouble with multiple user accounts

    I am still getting used to Aperture and am having trouble with multiple user accounts on my Mac.
    My wife and I have separate accounts on our Mac, and both have Administrator rights. We keep our Aperture library in the "Shared" folder, and I have made sure that both she and I have read/write capabilities on the Aperture library.
    However, she has difficulty creating new projects, saving data, and viewing thumbnails in Aperture. Whenever she creates a project, it does not save into Aperture, and cannot be viewed by any user. In addition, changes she makes to photos do not save. She also cannot view thumbnails of any photos (although she can see the photos in the viewer).
    Are there any changes I need to make to the user accounts so she can have all these capabilities?
    Many Thanks.

    Rather than having the Aperture library reside in the shared folder, keep it within a folder residing at the top level of your mac, eg.
    I actually keep mine on one of my RAID disks.
    Tony

  • I'm using Adobe Photoshop CS5 Extended and am having trouble with it.

    I just reinstalled Photoshop CS5 Extended from my original disk because I was having trouble with it. I did do an uninstall before installing. Every time I quit Photoshop I get this message: "Could not save Preferences because the file is locked or you do not have the necessary access privileges. Use the ‘Get Info’ command in the Finder to unlock the file or change permissions on the file or enclosing folders." Can you tell me what to do to fix this? I went to get info and made changes to read and write, but it made no difference. Thanks for your help.
    Richard

    Some folders are hidden in the Finder. Use the "Go to Folder" command for that.
    Go menu > Go to Folder, enter:
    /Users/YOURUSERNAME/Library/Preferences/Adobe Photoshop CS5 Settings
    Gene

  • I am having trouble with a form, won't tab to 2nd page...

    I am having trouble with a form I created in Acrobat Pro 10. I created tabs etc, they all work wonderfully in Adobe, but once I uploaded it onto the web-based program for other users, the tabs only work  on page 1, I have to click on page 2 to keep tabbing through.  It won't tab into it.  Any advise?  Also, when the users open it it opens in the web.

    1. The library is separate from the application, so re-installing shouldn't cause an issue with the actual photos. But it would be foolhardy in the extreme to do anything without first backing up.
    2. Often these issues are caused by a damaged Library, so reinstalling doesn't change much.
    FWIW
    To re-install iPhoto
    1. Put the iPhoto.app in the trash (Drag it from your Applications Folder to the trash)
    2a: On 10.5:  Go to HD/Library/Receipts and remove any pkg file there with iPhoto in the name.
    2b: On 10.6: Those receipts may be found as follows:  In the Finder use the Go menu and select Go To Folder. In the resulting window type
    /var/db/receipts/
    A Finder Window will open at that location and you can remove the iPhoto pkg files.
    3. Re-install.
    If you purchased an iLife Disk, then iPhoto is on it.
    If iPhoto was installed on your Mac when you go it then it’s on the System Restore disks that came with your Mac. Insert the first one and opt to ‘Install Bundled Applications Only.
    If you purchased it on the App Store you can find it in your Purchases List.
    Alternative approach:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Are people still having trouble with iPhone/HP Laptops?

    Since I've had my Envy I've had no end of trouble with getting it and the iPhone to play nice. Any my search continues. So far, I have updated every bios, reinstalled Windows 7/iTunes many times, have restored the iPhone far more times than I care to remember and I am STILL having troubles with this thing. Having got through the Syncing issues with the PM55 chipset and iPhone I can now sync with my laptop. However all is not well as it would seem that I cannot sync my photo's. It doesn't matter if I have 0gb, 15gb or 30gb free, iTunes is telling me that there is not enough memory available. This error seems like an old one and there is even some info in the Apple KB but after following all that I still can't get it to sync my photo's.
    Some info on my setup:
    HP Envy 15 (all the latest drivers installed, bios F.24) Core i7-820, 8gb ram etc.
    iPhone 32gb, ver 3.1.3
    iTunes (whatever the latest one is)
    I should add that I can sync my iPhone with an identical install of intunes on my vintage Quad core desktop PC, but as I use my Laptop a lot more (and have all my media, email, and contacts etc on it) I would prefer to sync to it.
    Is there anything that I can do? Its very frustrating to have blown $4k on this equipment and it doesn't work...

    Well I tried deleting the photocache but alas, no luck. I also tried syncing with just the photo's enabled, and it worked! So then I enabled my other media and that copied across too! I thought I was on a bit of a roll here, but now whenever I try and sync it will do one of 3 things:
    iTunes will crash.
    iTunes will indicate that there is not enough memory on the device (+9GB free)
    iTunes will remove the iPhone from the sidebar (and my computer/disk management) even though it will continue to charge.
    Interesting point to note is that it works fine (cable/iphone/itunes/media library) on my desktop and macbook. Still really disappointed that I cannot get these two to cooperate. Also still haven't got any contacts from outlook but that may not be related?

  • I'm having trouble with custom ringtones.  I have downloaded the free software "makeTones" and have created some ringtones.  I then copied those to Mac and played them in ITunes.  My Itunes does not have a ringtone tab.  I can not sync the ringtones.

    I'm having trouble with custom ringtones.  I have downloaded the free software "makeTones" and have created some ringtones.  I then copied those to Mac and played them in ITunes.  My Itunes library does not have a ringtones tab.  I can not sync the ringtones (or I don't know how)!  Please help.

    Yes, the file extension is M4R.  Does it matter where I save these files on my Macbook?  I then opened them in Itunes and played them.  I did find the Tones folder in Itunes but the Tones or Ringtones tab does not show up when I select Iphone (within Itunes).  When I open the Tones folder in the Library, it is empty.  Thanks in advance for your help.

  • Hi, having trouble with my iMac on startup. Background screen appears, but no icons,

    Having trouble with my iMac- on startup, the background screen appears, but no icons. The spinning beach ball appears for quite a long while, then when the icons finally come up, when I open a finder window, the only icons to appear are the Network and Macintosh HD icons. I've tried to repair disk permissions: this came up with heaps of errors, which it then fixed, but the original problem remains.
    Any suggestions on how to fix this?
    thanks

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins and log in as Guest. For instructions, launch the System Preferences application, select Help from the menu bar, and enter “Set up a guest account” (without the quotes) in the search box. Same problem(s)?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    Note: If you’ve activated “Find My Mac” or FileVault in Mac OS X 10.7 or later, then you can’t enable the Guest account. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Same problem(s) in safe mode?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • Having trouble with imports never finishing

    I am having trouble with imports that never finished. It is almost like the pictures are stuck on one image. the only way to get out of Iphoto is to force quit. The next time I open, there are a number of images that still need to be imported, but the import never finishes and seems to stop at the same image. When I go to close down I get the message that Photos are being imported to the library.
    Anyone have any suggestions.
    Thanks

    Photo:
    Welcome to the Apple Discussions. Check out your iPhoto library and make sure all photos are viewable and there. Force quitting when iPhoto is working can corrupt the database file, Library6.iPhoto. Make a backup copy of it and save in another folder.
    First make a backup copy of your iPhoto Library folder. Now download and run BatChmod on the iPhoto Library folder with the settings shown here, substituting your account name for mine. You can either type in the path to the folder or just drag the folder into that field. Open iPhoto and see if it will work OK.
    If not, launch iPhoto with the Command+Option keys depressed and follow the instructions to rebuild the library. Select all options.
    Lastly use iPhoto Library Manager to rebuild the library. Here's how:
    Using iPhoto Library Manager to Rebuild Your iPhoto Library
    Download iPhoto Library Manager and launch.
    Click on the Add Library button, navigate to your User/Pictures folder and select your iPhoto Library folder.
    Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File->Rebuild Library menu option
    In the next window name the new library and select the location you want it to be placed.
    Click on the Create button.
    Note: It can take some time to create the new library if you have a lot of photos. One user reported that with a library of about 5,000 images it took about 12 hours so plan ahead.
    Do you Twango?

  • HT203433 I'm having trouble with the purchased stickers.

    Dear iTunes Store Help Center
         I'm having trouble with the purchased stickers. I purchased LINE Sticker, Doraemon & Doremi. But Sticker are not show in my Sticker history and can not use sticker (Doremi). Please advise me what to do.
    My registration details:
    - Country : Thailand
    รายการ
    ผู้พัฒนา
    ประเภท
    ราคาต่อ หน่วย
    LINE, Doraemon & Dorami
    รายงานปัญหา
    NAVER JAPAN
    การซื้อผ่าน App
    $1.99
    LINE, Doraemon
    รายงานปัญหา
    NAVER JAPAN
    การซื้อผ่าน App
    $1.99
    ยอดรวมของใบสั่ง:
    $3.98
    <Personal Information Edited by Host>

    Most of the people on these public forums, including myself, are fellow users - you're not talking to iTunes Support here. I've asked the hosts to remove your email address from your post.
    Have you tried the help on the developer's site : https://line.naver.jp/help/iphone/en/serviceId/10155/sp ?
    If you haven't received the items then you contact iTunes Support via this page : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • I am having trouble with iPhoto-it won't launch.

    am having trouble with iPhoto-it won't launch and leaves a blank white screen box and spinning wheel of death-if I re-install software-will I lose all photos and faces settings? Any ideas-this is a Mac Pro and Xserve school system.
    It seemed to stem from when I was transferring some movie footage from an HD camcorder to iMovie.
    This is a school system and I'm worried I may lose many photos and face recognition data.
    Phil

    1. The library is separate from the application, so re-installing shouldn't cause an issue with the actual photos. But it would be foolhardy in the extreme to do anything without first backing up.
    2. Often these issues are caused by a damaged Library, so reinstalling doesn't change much.
    FWIW
    To re-install iPhoto
    1. Put the iPhoto.app in the trash (Drag it from your Applications Folder to the trash)
    2a: On 10.5:  Go to HD/Library/Receipts and remove any pkg file there with iPhoto in the name.
    2b: On 10.6: Those receipts may be found as follows:  In the Finder use the Go menu and select Go To Folder. In the resulting window type
    /var/db/receipts/
    A Finder Window will open at that location and you can remove the iPhoto pkg files.
    3. Re-install.
    If you purchased an iLife Disk, then iPhoto is on it.
    If iPhoto was installed on your Mac when you go it then it’s on the System Restore disks that came with your Mac. Insert the first one and opt to ‘Install Bundled Applications Only.
    If you purchased it on the App Store you can find it in your Purchases List.
    Alternative approach:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • I have 64-bit Vista on an HP laptop, and am having trouble with P4

    I have 64-bit Vista on an HP laptop, and am having trouble with P4. When I go to the "Compatibility" tab in for the P4 .exe file, 32-bit Vista does not show up as a compatibility option. The latest version shown is XP with SP2. Am I missing something? Is there a patch or download that updates P4?(The problem I'm having is stuttering and stopping in the imported avi2 files I have downloaded from my Panasonic digital camcorder and converted from avi to avi2 using DVDate. Also, I get stuttering with digital photos - jpg files - that I want to insert in the movie with added narration.)

    A.T. Romano
    It gets a little complicated. This is a simplification, but I hope this
    helps to visualize what's happening.
    The 32 bit and 64 bit environments are separated from each other.
    There are separate program files directories, separate shared dll library
    directories, and even separate registry entries. You can't mix 32 and
    64 bit modules, and some applications, like Internet Explorer, install
    both a 32 bit and a 64 bit version on the same computer. (IE does that
    so it can process web pages that use 32 bit executable controls).
    Vista 64 has 32 bit emulation built-in using a subsystem called Windows
    on Windows 64 or WOW64 for short. WOW64 intercepts 32 bit
    application calls to the operating system and handles the 32 to 64 bit
    conversions and the redirection of the file and registry locations.
    The program files themselves contain flags that indicate whether they
    are 32 bit and whether the file uses the 64 bit version of the file
    structure.
    If the program is marked 32 bit, it will run in 32 bit using WOW64.
    Programs are generally installed by an installer program which places
    the application files in the proper locations and writes the registry
    entries and any other setup tasks that are needed. To install a 64
    bit program, a 64 bit installer is needed. For 32 bit installers, the files
    and registry entries are redirected to the 32 bit locations.

Maybe you are looking for