How To use JVM (not CreateJavaVM)??

Using JNI, I want to call the java class from C..
Generally, I use "JNI_CreateJavaVM" method to create JavaVM's instance.
when it continually call C execution file,
it use much memory owing to creation of much JavaVM's Instances.
1. I want to know how to use before create instance
without creats another instance using "JNI_CreateJavaVM"
2. I want to know how to use JavaVM that only create one it's instance.
Any examples would be appreciated.
Thank you very much.

Hi,
try to create one C thread for every Java application that you have to start. See http://java.sun.com/docs/books/tutorial/native1.1/invoking/invo.html file attach.c
I.E. (hp-ux):
pthread_create()...
jvm->AttachCurrentThread((void **)&env,NULL);
jobjectArray joa = env->NewObjectArray(argc, env->FindClass("java/lang/String"), NULL); // Parameters....
jclass cls=env->FindClass("your class");
jmethodID mid=env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V");
[env->RegisterNatives(cls,pmethParGui,1);] JNI CALL
env->CallStaticVoidMethod(cls, mid, joa);
jvm->DetachCurrentThread();
pthread_exit...
If your Java application use static memory, your memory will be shared.

Similar Messages

  • How to use the not exists query

    Hello,
    Using obiee 11g,
    i would like to know how to deal with not exists query in the obiee11g,
    the query is like this
    select count(a.col1),a.col2 from table1 a ,table2 b where a.col1=b.col1
    and not exists
    (select d.col1 from table3 d, table4 e
    where d.col1=e.col1 and d.col1=a.col1)
    group by a.col2
    there are 4 tables.
    table1,table2,table3,tabel4
    this is what i need in a report,these tables are used in othere places also,
    would prefer if its possible to do in for a report i.e.e analysis itself.
    If not possible then may be in rpd since if i change in rpd it may reflect every place
    and not in for a report itself.
    thanks

    Implement this in report itself can be a tricky and tedious job..But better to have it in RPD - Physical - Select Table type
    USE NOT IN in place of NOT Exist..You can simply use SELECT statement in SELECT TABLE TYPE
    Hope it clear

  • How to use different (not local) user for NTLM auth in Authenticator?

    Hi All,
    I use custom authenticator to provide user / passwords to connect to .NET Web Services. I overloaded function getPasswordAuthentication() that returns right user / password combination for the requested URL. It all works perfectly for many kinds of HTTP connections: basic, ntlm, ntlm-v2, through proxy, ssl, etc.
    My problem is that during NTLM authentication from Windows computers JVM uses credentials of the currently logged in domain user instead of calling Authenticator to get other user / password provided by the user. In case when local user credentials fail to authenticate, JVM calls my Authenticator but in case authentication is successful it does uses local domain user and never calls my Authenticator. The issue is when this local domain user does not have enough permissions but authenticated correctly there is no way to supply JVM with another user to begin with.
    What can I do to force JVM to ignore local domain user and to use Authenticator to collect credentials during NTLM authentication requested by the server in case the software runs on a Windows box with currently logged in domain user?
    I am looking for the answer for a long time already but found only questions and suggestions to switch server from NTLM authentication which is not an option for me. From the developer's view it has to be pretty simple change for Sun to do in Java networking API. Is there any way to escalate it to Sun support? Maybe there is some property in some JRE patch level that allows to do this?
    Thank you very much!
    Mark

    Thank you for the reply. I have kind of an opposite problem. I can perfectly connect from Linux computers to Microsoft IIS servers using NTLM or even NTLMv2 authentication. My problem is connecting from Windows client computer joined to the same domain as IIS server with the domain user logged in to this computer. In this case this user account will be used in any HTTP connections I initiate to this IIS server instead of the one that I want to supply in my custom Authenticator.
    I have graphical interactive application that connects to IIS Server. When user runs it and connects to IIS server I want to prompt for the user/password regardless whether JRE may correctly authenticate using current user account credentials. The current user may not have enough permissions in IIS application so I want to use different user to login to IIS application.
    Thank you anyway,
    Mark

  • How to use power not battery?

    Just got new Mac Book Pro--my first laptop.  I am confused about the power cord and the power adapter.  How do I run the laptop using power connection instead of battery?  The power cord only plugs into the adapter, not the machine.  I'm off to a great start--can't seem to figure this out.

    Yes, in fact it's a good idea to use the AC adaptor whenever it's convenient. There's no harm done to the computer or to the battery. See more:
    About Batteries in Modern Apple Laptops
    Apple - Batteries - Notebooks
    Extending the Life of Your Laptop Battery
    Apple - Batteries
    Determining Battery Cycle Count
    Calibrating your computer's battery for best performance
    MacBook and MacBook Pro- Mac reduces processor speed when battery is removed while operating from an A-C adaptor
    Battery University
    Thanks for clarifying your question as I was certainly in the wrong ball park.

  • How to use drawLine not in Applet

    I need your help.
    I am new in Java programming.
    I use bean to display 3 photos on a web page.
    One is very big and the two last are like labels.
    I would like to draw a line from these labels to that big photo.
    And I did not succeed to use the drawLine method.
    Someone can help me please??
    Thanks
    Gwan

    Hi rapy_xjb!
    It's troublesome, would need to deploy applet and all dependent classes! A lot of files to download (in jar file or not)! Think in benefits to user after installing Java plug-in. My lemma: Java and diamonds are forever!
    Best regards.

  • How to use setTint() ?

    Hi, if you know how to use the setTint() funciton please,
    drop me and example code!
    What I am trying to do is tint 60% black some
    thumbnails(Sprites), it does have to be 60% perse, I can use a
    Black Shape on a Sprite on top of the thumbnails and set the color
    of the shape to 60% alpha to the black color but I saw setTint I
    want to use it, or how can I do the same thing using
    colorTransform, wich I know how to use, but not sure how to tweak
    the values to get it right.
    Thanks for your time!
    rS

    Well, no one
    OK so i did use colorTransform
    To do Something like Tint Black @ 50%
    ColorTransform(0.5, 0.5, 0.5, 1, 0, 0, 0, 0);
    To take it back to normal colors
    ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
    If you know a better way please share it
    rS

  • Is there instructions on how to use Xcode

    hi messing around with developing  is there instructions on how to use xcode not sure how 'hello world' useing c coding is working also theres a lot of options? read the java tip but really i dont know were to start

    no need to answer this i have seen were it is

  • How to set JMS clients to use JVM Invocation layer

    Hi,
    I'm not sure if this JBoss specific (but I'm assuming it's not) so I'll be asking it here. How can I set my JMS clients and Message-Driven Beans to use JVM Invocation layer since the clients and queues will reside in the same JVM.
    Thanks in advance.

    May be that explains why I couldn't successfully integrate ActiveMQ with JBoss. I was using the 3.0 version. I'll try again once I find the time.
    Anyway, do you know how to set JBoss JMS clients and MDBs to use JVM invocation or transport layer instead of UIL2?
    I'm not sure if what I've done is correct But here's what I've done.
    For jvm-il-service.xml, I changed the JNDI reference from "ConnectionFactory" to "JVMILConnectionFactory" since the default service uses "ConnectionFactory". Then I used that reference as my JNDI look up in my JMS client. I'm just not sure how to do this with MDBs. I think I should add an entry in the ejb descriptor file but I need someone to confirm.
    Thanks.

  • Is my installaton of CF MX 7 using JVM or not?

    I was recently directed to start using some "global logon"
    software with my application on our company intranet. I don't know
    if it is developed in-house or purchased.
    When I talked to the person providing the software, he asked
    if I was running "Windows and Coldfusion without JVM" or
    "Coldfusion on Windows (using JVM)". I wrote it this way because
    that is the way he asked it. Unfortunately, I didn't know the
    answer to the question. That's not my expertise. We talked for a
    while and he decided I needed his version for "without JVM".
    I've been working with the software for a couple of weeks now
    and it works, but only partially. It uses a cookie to provide
    security information back to the application, then the application
    is supposed to decrypt the cookie and get various pieces of info
    about the user. I'm only getting a small part of the information.
    I'm trying to get more information to determine if he sent me
    the wrong version. How would I find out if I'm using JVM or not?
    When I look in the CF Admin module at the "Java and JVM" tab, I see
    the installation path for JVM is "E:/CFusionMX7/runtime/jre" and
    some "JVM arguments" in a lower box. When I look in the "jre"
    subdirectory, I find subdirectories for bin, lib, and javaws plus a
    bunch of "License" files.
    I'm out of ideas to "fix" the software so I'm wondering if
    they sent the wrong one. Before you ask, I've already been on the
    phone with the provider and the tech support people with no help
    (obviously).
    The server is running Windows server 2003, IIS, MySQL, and CF
    MX 7.
    TIA

    quote:
    Originally posted by:
    Ian Skinner
    Yes ColdFusion 5 and earlier where written in C and thus do
    not use a
    JVM at all and ColdFusion 6 and latter are written Java and
    always use a
    JVM. But that JVM can be subsumed inside of the ColdFusion
    application
    and thus only available for use by ColdFusion or it can be
    installed
    independently of ColdFusion and is thus available for use by
    other
    Java|JSP applications.
    In other words the question is are you using either the
    Standard or
    Enterprise ColdFusion in Stand-Alone mode which embed the JVM
    into the
    ColdFusion installation. Or are you using Enterprise in
    Multi-Home or
    J2EE which install the JVM independently of ColdFusion and
    can be used
    by other applications.
    CF, whether installed in Server configuration or Multiserver
    configuration, uses a JVM included with CF. In either of these
    configurations, JRun is also used as the J2EE application server
    that the CF web app is deployed on. The only difference between
    these 2 is this:
    * In Server configuration, CF is installed with a
    stripped-down JRun designed to run nothing but the CF web app. You
    can't deploy other J2EE web apps, nor do you have access to the
    full JRun install. In this configuration, the JVM used to run the
    stripped-down JRun (and thus the CF web app) is installed at
    {CF_Install_Root}/runtime/jre.
    * In Multiserver configuration, JRun is installed, then CF
    is deployed as a web app on the full JRun install. You can deploy
    other J2EE web apps on this JRun install as well as change/access
    whatever you'd like within JRun. The JVM included with the full
    JRun install and used to run it, and thus the CF web app, is
    installed at {JRun_Install_Root}/jre
    CF, installed using J2EE configuration, is nothing more than
    a web app (.war) that needs to be deployed on your
    already-installed J2EE server.
    The wording you use makes me think you confuse JVM with J2EE
    app server. Especially this sentence:
    "But that JVM can be subsumed inside of the ColdFusion
    application
    and thus only available for use by ColdFusion or it can be
    installed
    independently of ColdFusion and is thus available for use by
    other
    Java|JSP applications."
    Replacing JVM with J2EE app server makes that sentence more
    accurate.
    The J2EE configuration doesn't install a JVM at all. It
    simply packages up a .war/.ear file for you to deploy on your own
    J2EE app server.

  • Does anyone know how i can view PDF files using Galaxy Note 2?

    Does anyone know how i can view PDF files using Galaxy Note 2?
    This is what i have been doing;
    I click on the file i wish to view (via a portal)
    this file goes to notification widget (i drag down screen)
    notification/message says download complete
    i click on notification/message
    nows it says complete action using (here i only have 2 icon options 1= DB Text Editor 2 = HTML Viewer)
    I have installed Adobe Reader.

    Can you confirm if the downloaded file is a pdf file, that is it ends with .pdf?

  • I do not know how to use i cloud. or i tunes anymore for that matter. can someone help me?

    I had not updated my Itunes in a while. when i got my mac i updated it to the latest version and i guess i set up i cloud but I have no idea how to use it. i have 1163 songs in my itunes library but they literally only show up some times and others they dont. it says i have all those songs in my music library on my phone but then half of them dont play and i dont understand why? most of my songs have a little cloud next to them like they need to be downloaded but i dont understand????
    I just want all my music on my phone.
    my phone also cant back up to icloud becase there is no storage but i have 3 backups under my back up and i dont know what to do? i lost my phone recently and i think it still has my old back up but i dont wanna delete that one cause im scared its gonna delete everything and i just really dont know what to do.
    does anyone know if im doing something wrong or what i can do to back up to my old back up or what?
    my contacts also always change names. or i put a number in my phone and it literally disappears 2 minutes later. ill save the number again and it does it again but then i look back in a ciuple of weeks and i have 4 of the same contact. its very frustrating

    Did you enable the "Find my..." function BEFORE you lost it?

  • On my iPad I have a working icloud that I have complete access to, but on my iPhone it keeps asking me for the password for it, but I do not know it! And the email that I used is not activated anymore! How do I delete the icloud account on my phone?

    On my iPad I have a working icloud that I have complete access to, but on my iPhone it keeps asking me for the password for it, but I do not know it! And the email that I used is not activated anymore! How do I delete the icloud account on my phone?

    Hi Aurion23,
    If you intend to keep using iCloud on your iPad, your best course of action would be to update your Apple ID/iCloud information so that you have a known password and it is associated with an active email address. You may find the following articles helpful:
    iCloud: Change your iCloud password
    http://support.apple.com/kb/ph2617
    Apple ID: Changing your Apple ID
    http://support.apple.com/kb/ht5621
    Regards,
    - Brenden

  • I recently bought an iphone 4s from people who are not in the know and restore my iphone .. Now do not be in use for not having ID and password ... Owner apple owner just gave me a serial number how do I want to continue to use this ... Their telephone he

    I recently bought an iphone 4s from people who are not in the know
    and restore my iphone .. Now do not be in use for not having ID and password ... Owner apple owner just gave me a serial number how do I want to continue to use this ... Their telephone help me: (

    I am having same problem . i can not use the phone. my Carrier ROGERS checked the phone its not stolen or lost phone but after restoring always ask for apple ID of previous owner and seller is not responding to any mails or phone if some one can help me out than it will be great.
    thank you

  • How to use Notes in Mail?

    .. e.g.
    1. Where are Notes saved on a MacBook after File > New Note ... write note ... File > Save?
    2. Can you write a Note in OS X Lion Mail / MacBook, and end up with it in Notes on an iPad/iPhone?
    The above covers it, the rest is a rant.
    First, when apps have generic names like Mail or Notes, it makes it difficult to search for anything useful about them .. got to live with this. I have a cold too .. got to live with that, but I mention it as I feel under the weather and am getting fed up trying to do something simple and having to trawl the Support Community and Web with searches about Notes in Mail, just to find out how I should make effective use of Notes in OS X Lion Mail.
    My question is in the heading. We all create Notes on our iPhone or iPad etc., and either end up with them in the Mail app on our Mac(Book) using IMAP or are using iCloud and can interact with the Notes there. However, I thought I'd try creating a new Note in the Mail app on my MacBook and push it the other way, to my iPad, or whatever. Although I'm using iCloud, my current set up uses IMAP to move my Notes around so forget iCloud for a minute. Great news in Mail, using File > New Note, was that the Note can have attachments, and if you attach a GIF say, you get the image in the Note - maybe everyone knows this and I'm the idiot.
    So, I create a Note with attachments and just want to save it so it will end up on my iPad etc. .. File > Save is available, simple. However, where is the Note saved? It looks a lot to me like it's not saved anywhere and if you close it, have fun trying to find it again.
    My research found a thread talking about making Notes searchable again by running the following Terminal command: mdimport ~/Library/Mail, but I really am not in the mood to press every button when all I am trying to do is basic functionality that I would expect to find in the "OS X Lion Applications User Guide" that other research here tells me doesn't exist (happy to be wrong).
    Sorry to go on but it is mildly theraputic. Back to where the Note is saved, I did find that if you hit Send on the Note and then hit File > Save, you do get a copy of your draft email with No Recipients etc., in Drafts. However, it's an email with a Note in it, not a Note as found under Reminders > Notes, that you get when syncing a Note from your iPhone/iPad - it's also not going to end up in Notes on the iPad. Hmmm, another way to put these questions is: How do you write a Note on your Mac and end up with it in Notes on your iPhone/iPad? This cold must be really bad because this has to be such a dumb question.

    I had the same issue. I found the answer on another thread written by an user named "hhoeksma". Here's what he/she wrote:
    "You may be able to retrieve your Notes. They are probably in your Home folder under Library/Mail/V2/Mailboxes/Notes.mbox. You should make a copy of this folder and save it elsewhere; then look through the folders within this mailbox for files with a .emlx suffix. These files are your actual notes. If you open them they will open in mail and look like messages. You can then copy the contents elsewhere.
    If your Library folder is not visible, go to the Finder, hold down the option key and select the Go menu--it will appear in the list.
    I still do not have a way to synchronize (without iCloud) the Notes on my iPhone with those on my Mac, but at least I have the Notes accessible on my Mac."
    hope it works for you too.

  • How to use "Notes" on my iPad with my existing iCloud address?

    How to use "Notes" on my iPad with my existing iCloud address? It asks me to create a new one...

    Did I overlook some critical info here? I'm having the same problem described by Henry5, but I'm signed in to iCloud with my AppleID which is not the same as my Mobile Me/iCloud email. I keep being asked to create an account (which it won't allow me to do since the account already exists) but no where do I see an option to use the existing account. I also tried logging out with my AppleID account, and using the iCloud email, but that doesn't work.
    I just want to sync my notes and mail... this is really irritating!

Maybe you are looking for

  • IWeb08; Photo Gallery: Can I have Photo open in a new window?

    In the old version of iWeb I had a photo gallery and when a person clicked on the image it would open in a new window. I preferred this to what it does now where a person clicks and they are take to a "review" page of all of the images on the page. I

  • What are the tools used in supporting project l2 & l3

    hi , good morning everbody..... what are the tools used in supporting project .............. thanks, hari shankar.

  • Muse Preview Doesn't Match Browser Preview

    I have a vertical rectangle on my pages (custom menu on top) that appears appropriately when I preview the pages in Muse.  However, when I preview the site in a browser the rectangle cuts off halfway down on 2 of the 3 pages.  I've grouped the elemen

  • HP530 not hibernating when USB WLAN stick plugged in, works unplugged.

    This problem came up when the laptop's builtin wlan card didn't connect to our wlan because of the 13 byte key (5 byte key worked fine but my dad wants to use the 13 byte key). I tried using an external USB wlan stick which connected fine to our netw

  • Storage capacity

    Hi! I just acquired my daughter's old iPod mini. I have successfully downloaded my own music to it. I am wondering, about 1/2 is music, another 1/2 is "other" and about 100Mb free. What is in the "other" section and can I clear that so that I can dow