Need to use default package for JNI code?

Hi,
I don't have much experience with JNI code, so excuse me if I make a silly mistake.
I have a set of DLLs to interface with Microsoft native speech code ("Microsoft Sam") -- a GPL library called Quadmore. Quadmore has some sample Java code to work with the libraries, all of which they put in the default package (no package). If I move their code to a named package, it breaks. The Java code is able to load th libraries, but can't find any of the methods.
Looking at the source for their DLLs (though I don't speak C++), the method names are things like
JNIEXPORT jboolean JNICALL Java_QuadmoreTTS_SpeakDarling(JNIEnv *env,jobject obj,jstring strInput)As far as I understand, this implies that the QuadmoreTTS.class that calls the code must be in the default package, as otherwise the method name needs to be prepended with a package name.
If that's so, then there's no way I can use the code as-is, right? Naturally, the rest of my program is in named packages, and I can't import any class that is in the default package, right? I've tried placing all their code in a jar and adding the jar to my classpath, but I still can't import any of their classes as they are in the default package.
Is the only solution to re-compile all their C/C++ code to let it use packages? Am I being dumb and missing something? I'm pretty sure other people have used Quadmore before, so I can't believe that they've never had this problem before.
Any suggestions greatly appreciated!
Sam

C/C++ functions in JNI must conform to the prototypes produced by running the javah compiler against the class file with native methods in it. So if you move the class to another package, the prototypes change. If you doun't change the compiled C coudes to suit, you will get undefined method errors when you load the dll as the JVM won't be able to match the native methods to the methods in the dll (it will call WinLoadLibrary() and WinLoadProcAddress() or somesuch under Windows).

Similar Messages

  • Do I need to import any package for running exit(0)

    i m using exit(0) but error is given on compilation.......do i need to import any package for exit() fucntion

    Do you mean System.exit?

  • IPhone 5s with hearing aids via Bluetooth. Need to use the phone for voice, what's the best distance that the mic will pick up your voice

    I wear hearing aids that are made for Apple, the audio will go into the hearing aids via Bluetooth. I'll need to use my phone for voice only.. I drive for work and have a wok oh one too and both are synced to a bluetooh headset (LG). I'm trying to figure out how to talk on both phones ( use speakerphone on work phone?) without using a bluretooh headset.  I don't know the range of the microphone on the IPHON, thinking about hanging it around my neck or put the phone into a stand/holder on the dash and use the speakerphone feature.  Looking for ideas to make this simple

    You can't do anything with that problem.
    Take your iPhone to the closest Apple Store and they will give you new one for 200€/$ or if you bought your iPhone in less than 12 months you will get it for free.

  • Default costcentre for gl codes

    Hi,
    my reauirement is default costcentre for gl codes. i was done configaration costcentre assign to gl codes in default assignment KA02, it is working on GL,AP,AR,AA but it is not work while creating the purchase requistion. can u give sugistion has any another configuration for purchase requistion mm side.
    Moderator: Please, avoid asking basic questions

    Hi Expert,
    Check by configuring the below steps in T-Code: OBYC,
    Select the Transaction - GBB and Enter Chart of Accounts and provide the GL Account(Post Automatically in GL Account Creation in T-Code: FS00)(which is assigned to default cost center) with respect to Valuation Class - Service and General Modifier - VBR: for internal goods issues (for example, for cost center)
    Do the Purchase Requisition - ME51N and Provide the Account Assignment Category - K - Cost Center and Item Category - (Blank or D - Service) and Check whether it is picking the cost center automatically.
    Check with the T-Code: OKB9, for Default Cost Center account assignment Settings
    Regards,
    GK
    SAP

  • Need to set default values for the fields plant and location in ME21N

    Hi All,
    i need to set default values for the fields plant and location in ME21N tcode.
    In accout assignment if we give 'A' then we need to create asset by clicking the Asset tab,there you have the fields plant and location.
    How to resolve this?
    Thanks in Advance

    hi .
    i needed to set default strorage location and plant in personal setting  in me21n.
    i solve it with this way.
    go to program SAPLMEPERS in se38.
    create new function in output with the sample name :MODULE ZTEST_001 OUTPUT.
    in this module write:
    if MEPOITEM_PROP-WERKS is INITIAL and  MEPOITEM_PROP-LGORT is INITIAL.
    MEPOITEM_PROP-WERKS = '1000'.
    MEPOITEM_PROP-LGORT = '0032'.
    endif.
    this is the solution.
    best regards.
    maryam

  • We have Enfocus pitstop server 64 bit in which we need to use Adobe CMM  for colour collaboration

    We have Enfocus pitstop server 64 bit in which we need to use Adobe CMM  for colour collaboration.
    Adobe CMM 64 bit is not available for integerating with Pitstop server

    Rather old and for older versions of Windows, but check out Adobe - Adobe Color Management Module (CMM) : For Windows : Adobe Color Management Module (CMM) and this forum: Adobe Color Management Modules

  • If my iphone 4s was unlocked by AT&T, but I need to use my warranty for a new iphone. Do I need to reunlock the new iphone? or will apple give me an unlocked iphone?

    If my iphone 4s was unlocked by AT&T, but I need to use my warranty for a new iphone. Do I need to reunlock the new iphone? or will apple give me an unlocked iphone?

    If your phone is officially unlocked, you will get an officially unlocked iPhone if yours is replaced under warranty. Apple maintains a data base of officially unlocked iPhones & can verify whether your phone is officially unlocked or not. To be safe, point this out to the genius bar, if you go to an Apple store or whoever you talk to, if dealing with AppleCare.

  • Loading jni dll using default package vs. specified package

    The following code:
    public class TestJni {
         public static void main(String[] args) throws Exception {
         System.loadLibrary("artjnidll");
         NARTG_CoreLib test = new NARTG_CoreLib();
    works so long as it is in my project's "default" package together with the jni source files.
    when I try to separate the jni source files into a package, say "artjni" & try to run the following code:
    import artjni.NARTG_CoreLib;
    public class TestJni {
         public static void main(String[] args) throws Exception {
         System.loadLibrary("artjnidll");
         NARTG_CoreLib test = new NARTG_CoreLib();
    i get an unsatisfied link error
    Exception in thread "main" java.lang.UnsatisfiedLinkError: artjni.artAPIJNI.new_NARTG_CoreLib()J
         at artjni.artAPIJNI.new_NARTG_CoreLib(Native Method)
         at artjni.NARTG_CoreLib.<init>(NARTG_CoreLib.java:31)
         at testartjni.TestJni.main(TestJni.java:18)
    even though the library loads fine. Can anyone help me understand why this is happening?
    Thanks so much for the help, d.

    jasro wrote:
    Could you elaborate a little bit? Maybe provide an example? How exactly should I rename the jni wrapper functions?1. Run javah again.
    2. Verify that the signatures in the h file match those in the c/cpp file.
    3. Include the h file in the c/cpp file.

  • Set Default value for transaction code F-36

    Hi
    I need to set default value to feild special G/L indicator in transaction code F-36 How can I do that. Please advice.
    Regards
    Kesharika

    Just in case anyone would need to know. You can change the default values for transactions by using SE93.
    Regards,

  • Need to specify default filename for SaveAs

    I am using the command app.execMenuItem("SaveAs"); in the click event of a button. Is there anyway that I can specify a default filename for the user? I do want the user to get the Save As window and the ability to change the name if possible.
    The form is generated by the RenderForm Java script, and the name being generated as a default for the SaveAs window is RenderForm.pdf
    Thanks,
    Velvet

    Chris, I think you missed this one.
    I think you want to change the name when calling app.SaveAs via javascript from the client not on the server. Since app.executeMenuItem("saveAs") will not take any parameters to suggest a file name. I think you will have to use doc.saveAs which will allow the name to be specified. This would require a trustedFunction which may or will not work unless you have known users. You will also need to prompt for the file name before making the call.
    Here is some untested code to get you started...
    You will need to create a trustedFunction (see AcroJS.pdf for details) ..
    saveFunc = app.trustedFunction(function (filename) {
    app.beginPriv();
    try {
    event.target.saveAs({cPath: filename});
    } catch (err) {
    app.alert("Error: " + err);
    app.endPriv();
    Code for your event...
    var suggestedName = "MyPDFName.pdf";
    // Note This will only work if you know where they will be saving it
    var cPathToSaveTo = "/c/temp/";
    var cResponse = app.response({
    cQuestion: "What name would you like to use for this PDF?",
    cTitle: "File Name",
    cDefault: suggestedName,
    cLabel: "File Name:" })
    if(cResponse != null)
    saveFunc(cPathToSaveTo + cResponse );
    Hope this helps.
    Rich Ruiz
    Novanis

  • Help needed: making a psptoolchain package for arch

    Hi....
    I'm very new to archlinux (now using it for 3 weeks), but I really like it
    Now I tried to make a archlinux package for the psptoolchain (PSP's are so nice )
    I already got a working package for the psp-gcc and the psp-binutils (wrote my own PKGBUILD's) which came with the psptoolchain.
    But now I got stuck with psp-newlib and pspsdk.
    At the moment I'm building all the packages separately, but later I'll try to make one package for the whole psptoolchain....
    So here comes my problem with psp-newlib and pspsdk...
    psp-gcc -march=i686 -O2 -pipe -G0 -Wall -I../../src/base -I../../src/kernel -c sceAtrac3plus.S
    sceAtrac3plus.S:0: error: bad value (i686) for -march
    Assembler messages:
    Error: Bad value (i686) for -march
    make[3]: *** [sceAtrac3plus.o] Error 1
    make[3]: Leaving directory `/mnt/data/archlinux/packages/psptoolchain/pspsdk/src/pspsdk/src/atrac3'
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory `/mnt/data/archlinux/packages/psptoolchain/pspsdk/src/pspsdk/src'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/mnt/data/archlinux/packages/psptoolchain/pspsdk/src/pspsdk'
    make: *** [all] Error 2
    ==> ERROR: Build Failed. Aborting...
    And here comes my PKGBUILD for psp-newlib:
    # Contributor: [email protected]
    pkgname=newlib
    pkgver=1.13.0
    pkgrel=1
    pkgdesc="GCC for psp-devel"
    url="http://ps2dev.org/psp/Tools/Toolchain/"
    depends=()
    makedepends=()
    source=(ftp://sources.redhat.com/pub/newlib/$pkgname-$pkgver.tar.gz)
    md5sums=('3d07cc367a22b78c44227456b0d3b7dc')
    build() {
    export PSPDEV="/usr/local/pspdev"
    export PATH="$PATH:$PSPDEV/bin"
    cp $startdir/newlib-1.13.0.patch /$startdir/src/$pkgname-$pkgver
    cd $startdir/src/$pkgname-$pkgver
    cat newlib-1.13.0.patch | patch -p1
    cd /$startdir/src/$pkgname-$pkgver
    BUILDDIR="/tmp/pspdev" PSPDEV="/usr/local/pspdev" ./configure --prefix=/usr/local/pspdev --target=psp
    make || return 1
    make DESTDIR=$startdir/pkg install
    I know, using newlib as pkgname is bad, but later I'll change it to psp-newlib and I'll replace the $pkgname's with newlib (I hope this idea isn't too bad)
    One last thing: psp-binutils and psp-gcc are installed in "/usr/local/pspdev"
    I hope you can help me
    thanks, and have a nice day
    XazZ

    After a long break I decided to work on the PKGBUILD again.
    Now I got two PKGBUILD's: one for the psptoolchain and one for pspsdk (pspsdk gets updated very often, so I decided to create an extra PKGBUILD).
    I'm not sure if my PKGBUILD's fit the PKGBUILD-standard
    First thing before I post my PKGBUILD's: I'm not finished with adding all required fields (as license and so on)!
    Here comes the one for psptoolchain:
    pkgname=psptoolchain
    pkgver=2211
    pkgrel=1
    pkgdesc="A collection of tools to create executables for the Sony PSP"
    url="http://ps2dev.org/psp/Tools/Toolchain/"
    depends=('subversion' 'texinfo')
    makedepends=()
    license=('GPL')
    source=(ftp://ftp.gnu.org/pub/gnu/binutils/binutils-2.16.1.tar.bz2 ftp://ftp.gnu.org/pub/gnu/gcc/gcc-4.0.2/gcc-4.0.2.tar.bz2 ftp://sources.redhat.com/pub/newlib/newlib-1.15.0.tar.gz)
    md5sums=('6a9d529efb285071dad10e1f3d2b2967'
    'a659b8388cac9db2b13e056e574ceeb0'
    '4020004b1b7a56ca4cf7f6d35b40a4cb')
    sha1sums=('5c80fd5657da47efc16a63fdd93ef7395319fbbf'
    'f1b714c6398393d8f7f4ad5be933b462a95b075d'
    'f6860b36e48fb831a30bab491230bbc7ce2669a2')
    arch=('i686')
    _svntrunk=svn://svn.pspdev.org/psp/trunk/psptoolchain
    _svnmod=psptoolchain
    _svntrunk1=svn://svn.pspdev.org/psp/trunk/pspsdk
    _svnmod1=pspsdk
    build() {
    cd $startdir/src
    svn co $_svntrunk $_svnmod
    cd psptoolchain
    cp binutils-2.16.1.patch $startdir/src/binutils-2.16.1/
    cp gcc-4.0.2.patch $startdir/src/gcc-4.0.2/
    cp newlib-1.15.0.patch $startdir/src/newlib-1.15.0
    export PSPDEV="$startdir/pkg/usr/local/pspdev"
    export PATH="$PATH:$PSPDEV/bin"
    msg "patching and building binutils..."
    cd $startdir/src/binutils-2.16.1
    cat binutils-2.16.1.patch | patch -p1
    ./configure --prefix=/usr/local/pspdev --target=psp --enable-install-libbfd
    make clean || return 1
    make || return 1
    make DESTDIR=$startdir/pkg install
    msg "building and patching binutils finished"
    msg ""
    msg "patching and building gcc..."
    cd $startdir/src/gcc-4.0.2
    cat gcc-4.0.2.patch | patch -p1
    mkdir objdir
    cd $startdir/src/gcc-4.0.2/objdir
    ../configure --prefix=$startdir/pkg/usr/local/pspdev --target=psp --enable-languages="c" --with-newlib --without-headers
    make || return 1
    make DESTDIR=/ install
    msg "building and patching gcc finished"
    msg ""
    msg "building pspsdk-headers - we'll only need them temporary"
    cd $startdir/src/
    svn co $_svntrunk1 $_svnmod1
    cd $_svnmod1/
    ./bootstrap
    ./configure --prefix=/usr/local/pspdev -with-pspdev=/usr/local/pspdev
    make clean || return 1
    make DESTDIR=$startdir/pkg install-data
    msg "building pspsdk-headers finished"
    msg ""
    msg "patching and building newlib-psp"
    cd $startdir/src/newlib-1.15.0
    cat newlib-1.15.0.patch | patch -p1
    ./configure --prefix=$startdir/pkg/usr/local/pspdev --target=psp
    make || return 1
    make DESTDIR=/ install
    msg "building newlib-psp finished"
    msg ""
    msg "building gcc-c++"
    cd $startdir/src/gcc-4.0.2
    mkdir build-psp-c++
    cd $startdir/src/gcc-4.0.2/build-psp-c++
    ../configure --prefix=$startdir/pkg/usr/local/pspdev --target=psp --enable-languages="c,c++" --with-newlib --enable-cxx-flags="-G0"
    make clean || return 1
    make CFLAGS_FOR_TARGET="-G0"
    make || return 1
    make DESTDIR=/ install
    msg "building gcc-c++ finished"
    msg ""
    msg "removing unnecessary code"
    cd $startdir/pkg/usr/local/pspdev/psp
    rm -rf sdk
    msg "Now you need to build and install pspsdk!"
    And here the one for pspsdk:
    pkgname=pspsdk
    pkgver=2209
    pkgrel=1
    pkgdesc="A collection of Open Source tools and libraries written for the Sony Playstation Portable (PSP)."
    url="http://ps2dev.org/psp/Tools/Toolchain/"
    depends=('psptoolchain')
    makedepends=()
    arch=('i686')
    license="custom"
    _svntrunk=svn://svn.pspdev.org/psp/trunk/pspsdk
    _svnmod=pspsdk
    build() {
    export PSPDEV="/usr/local/pspdev"
    export PATH="$PATH:$PSPDEV/bin"
    cd $startdir/src
    svn co $_svntrunk $_svnmod
    cd $_svnmod/
    ./bootstrap
    ./configure --prefix=/usr/local/pspdev -with-pspdev=/usr/local/pspdev
    make clean || return 1
    make DESTDIR=$startdir/pkg install-data
    make clean || return 1
    ./configure --prefix=$startdir/pkg/usr/local/pspdev -with-pspdev=/usr/local/pspdev
    make || return 1
    make DESTDIR=$startdir/pkg install
    Some explanation: I've used this one very often: --prefix=$startdir/pkg/usr/local/pspdev
    Explanation: When I wanted to create only one PKGBUILD for the psptoolchain, some dependences were in $startdir/pkg. If you take  --prefix=/usr/local/pspdev he won't get some depencies (mostly header files), which means I had to create single PKGBUILD's for every part of the psptoolchain (that would be 6 single parts).
    Those --prefix-changes don't stop my psp environment from working! (tested it myself - I comiled almos all sample apps which were included in the pspsdk - and all compiled well)
    I hope we can find a better solution than mine.
    Thanks in advance
    XazZ

  • We need a teacher tablet package for schools

    Wy doesn't Apple get hip to the needs of educators and capture a piece of the pie to get technology into teachers hands? Apple should create a package that could be advertised to district superintendants and administrators; the package should include one main computer for the school with an Apple account for the school, X number of ipads depending on school needs with an app bundle that includes iworks, Microsoft office, and for gods sake the ability to run flash and java. This could either be a third party app or Apple could realize there is a need, Hawaii uses eSIS for grading and attendance which requires java. We may be purchasing Asus Eeee tablet computers instead of ipads simply because of this. If a school purchases ipads now, teachers have to buy their own apps yet they do not own the ipad. Creating a bundle of most used apps allows schools a one time purchase that allows schools and teachers to get up and running immediatly with the basics needed in our profession. Then leadership teams could decide what other apps they want to purchase as they go.
    Is anybody listening?

    Microsoft would have to make office for iPad-not Apple.
    Flash and java are not going to happen, no matter what misguided reasons you want it.
    Some links you may find educational:
    http://www.apple.com/hotnews/thoughts-on-flash/
    http://ipadeducators.ning.com/m/
    http://www.iear.org/
    http://www.nytimes.com/2011/01/05/education/05tablets.html?pagewanted=all
    http://www.usatoday.com/money/industries/technology/2011-08-02-inkling-ipad-e-te xtbooks_n.htm

  • Do I need to use Flex Files for a 24 fps edit?

    Hello.
    I am shooting on 16mm film, transferring to video (with key code burn in), editing on Final Cut 4, then matching back to film.
    I would like to save money by not having to create Flex Files, and was told that if I do a reverse telecine in Cinema Tools (converting 29.97 transfer to 24), and then edit at 24 in FCP, I will be able to generate (manually) my own cut list when I am done by noting the key code burned at the head and tail frame of my shots. The Cinema Tools manual even implies it would be able to generate a cut list itself?
    Can anyone speak to this or tell me why this plan wouldn't work--why I absolutely need a flex file? This will be a short film (under 10 minutes) and I will be capturing all the footage for the edit, so I don't need the flex file for help with capture, and I don't mind the time needed to log key codes myself for the cut list.
    Thanks so much in advance for any help!

    Hi. It costs enough to make a difference for my very, very small budget--a flat fee each time I transfer and I am shooting 100 foot rolls so there could be up to five or more transfers. Since I am capturing everything (entire camera rolls), I'm trying to understand if I need the flex files--if the key code is burned in, can't I use that for cut list? In other words, if I don't need the files for importing, what other reasons would you strongly advise me to have them made?

  • Using a package for solving many mutating tables.....

    Hi,
    I need to solve more than one cases of mutating tables .. following the 'traditional' way described in:
    http://asktom.oracle.com/tkyte/Mutate/index.html
    For these cases , do you recommend me to use an individual package for each case ... or one to cover all cases (with different variables and PL/SQL tables... of course)....???
    Many thanks ,
    Simon

    No , I meant that there are cases on different
    tables....Then there is no other possibility but to create different packages.
    When you write "use api's"... can you give some more
    details....?????I mean to have a package to do all your dml in nice clean functions and procedures like procedure hire_employee, procedure fire_employee, function salary_including_commission and so on. Your procedures will include logic to validate all business rules. Then grant execute privileges on this package (api) to the users that should be able to work with employees and revoke all DML privileges on the table from anyone, even revoke the "CREATE SESSION" privilege from the schema owner when done installing to prevent direct access on the table.
    Now every DML action will be through your api and it's not possible to bypass constraint validation.
    Regards,
    Rob.

  • Using MBGMCR03 Inbound for reason code

    I'm in the Functional Speccing stage of a project. the process I need to document is this: Requirement to post goods movements interfaced into SAP from an external system. I have scoured the forums throughout the web and found only 1 thing similar (on this site) - solution is to use WMMBXY/WMMBID02.
    The problem with this is that there is no specific field for reason code (which I need to use) in WMMBID02 as there is in MBGMCR03.
    How can I use MBGMCR03 inbound when it has no associated inbound process code bearing in mind that the SAP system is to have no custom developments/modifications? If I have to do some mods what is the minimum that needs to be done either for WMMBID02 to have additional reason code field or for MBGMCR03 to become inbound-friendly?
    Thanks in advance for any help!
    Jay

    More info? In WMMBID02 the field E1MBXYI-GRUND for reason code (as in table MSEG) is there but its text refers to Asset master records. It has only 3 characters allowed and refers to table T098.
    The MBGMCR03 field E1BP2017_GM_ITEM_CREATE-MOVE_REAS (data element MB_GRBEW (same as in MSEG-GRUND)) refers to table T157D and has 4 characters and so seems to have no correlation with WMMBID02.
    Anyone have any ideas? Can I still use the GRUND field from E1MBXYI?
    Jay

Maybe you are looking for

  • One itunes account two phones with mixed up apps

    I have an iphone 3Gs (Hers)and my boyf 4 (His), and i used my itunes on my computer to put music on his phone before- no problems. I had upgraded my phone to iOS 5.1 and a few days later did his. iTunes recognised the phone id as "His" and proceeded

  • Not able to select value in MSC1N

    Hello All, I am trying to create the batch using MSC1N. I am not able to select the characteristics values for few characteristcs. I am using selected sets and code groups for those characterisctis. For others it is working properly. I am getting the

  • Java Mail - Small problem

    I've just installed Javamail and I've gotten the demo servlet working. However I've compiled my own Javamail servlet, but it doesn't seem to be working. It compiles correctly, but it doesn't send the email. I have the correct settings for the SMTP an

  • JTree icons getting cropped

    Hi, I have a JTree in which I show the local file system. I set the cell renederer to this: private class SourceTreeCellRenderer extends DefaultTreeCellRenderer                public Component getTreeCellRendererComponent(JTree tree, Object value, bo

  • Thunderbird automatically changes resolution of attached incoming and outgoing image files to 72 dpi. How can I prevent this?

    Using Thunderbird 31.4.0 on Win7 Professional with full Admin rights. It seems that all jpeg files larger than 50 KB (or maybe even smaller) are automatically altered from their original resolution of 300 dpi (or higher) to 72 dpi, both outgoing as w