How to load jvm.dll (in C++) ?

Hi friends,
I've started using JVM for one of my software. I've understood how it works.
But now i want to create my own application which can take any .class or .jar file and then start executing the same through my program (C++).
I don't know from where to start. Can anybody help me? (May be with some sample code of C++ for the same?)
Thanks in advance

Thanks for responding my query,
But i'm aware of how to load any dll in C++, but i want to know which functions are avaible with jvm.dll and help on those functions.
For example JNIenv or some thing is used in C++ which is related to java environment. So what do that mean?
If i want to know how many classes exist in given jar file then which method out of jvm.dll should i go for?
If some I get some program, that will be beneficial.
Thanks again.

Similar Messages

  • Win2000 & 1.4.0 Beta2: Could not load jvm.dll

    Question: How does 1.4 Beta2 find it's resources?
    When trying to run Install Anywhere 4.5, I get the error message:
    Can't launch executable.
    Could not load jvm.dll
    Try re-installing the Java VM and change the java VM used by the application
    The call is
    D:\Compiere2\jre\bin\java.exe -Xms16777216 -Xmx50331648 -noverify com.zerog.lax.LAX C:\\Temp\\I1003700413\\Windows\\CUpdate.lax C:\\Temp\\env.prop
    OK, I have about 4 different SDKs installed and I heard that if you deinstall everything else and just install 1.4 Beta 2 - it supposetly works. This is not an option, if you try to install/upgrade an application where the user does not know that a VM is.
    The environment:
    JAVA_HOME is set to a 1.4.0 Beta 2 JRE and the PATH is also pointing to the \bin directory ... and in their server/client sub-directories is the jvm.dll
    I guess, that some registry entry is used ... but where do I find that?

    You're running Java2 from "D:\Compiere2\jre". Does the file "D:\Compiere2\jre\bin\hotspot\jvm.dll" exist? And is this the installation which is Java 1.4?
    As far as where the registry entry is kept, it is in HKEY_LOCAL_MACHINE/Software/JavaSoft. However, this value only seems to be used when you run the java.exe which Sun install in the Windows system directory.

  • Cannot load jvm.dll

    I have installed j2sdk 1.4.2, on windows ME. it seems to have installed ok, but when i try to run it, i just get a message saying "cannot load jvm.dll" Any suggestions?

    I have installed j2sdk 1.4.2, on windows ME. it seems
    to have installed ok, but when i try to run it, i just
    get a message saying "cannot load jvm.dll" Any
    suggestions?Are you using NetBeans?
    If yes, look here:
    http://forum.java.sun.com/thread.jsp?forum=14&thread=434036

  • Can't load jvm.dll

    the following simple code can't load jvm.dll
    at windows xp sp2 ,
    jre-1_5_0_11
    #include <jni.h>
    #include <stdio.h>
    int main() {
         HINSTANCE hVM;
    if((hVM = LoadLibray("C:\\Program Files\\Java\\jre1.5.0_11\\bin\clien\\jvm.dll"))==NULL){
    printf("faild\n");
    else
    printf("succes\n");
         return 0;
    }

    #include <iostream>
    #include <stdlib.h>
    #include <windows.h>
    using namespace std;
    int main(int argc, char *argv[])
    HINSTANCE hVM;
    char *path="C:\\Program Files\\Java\\jre1.5.0_11\\bin\client\\jvm.dll";
    if((hVM = LoadLibrary(path))==NULL){
    printf("Error : %d\n",GetLastError());
    else{
    printf("succes\n");
    FreeLibrary(hVM);
    return 0;
    }

  • IDE Cannot load jvm.dll - what fixes this?

    Hi,
    I have Sun One Community Edition installed.
    I then installed Java web start again and now when I try and run Sun One Community Edition it return the following error:
    IDE
    Cannot load jvm.dll
    Any suggestions as to where I can find information on this or what the fix is.
    Why cant sun package 1 product, rather than having to install Sun ONE App Server, then find it dosnt work, then install J2EE to fix that, now find Sun One does not work...

    Maybe an incompatible jvm.dll is now in the PATH? I've never used Sun One but it's one possibility...

  • "Cannot load jvm.dll" please help solve

    Hello
    I downloaded and installed the following onto windows 98 SE :
    JavaSE installed @ C:\Program Files\Java\j2re1.4.2
    Java2 SDK installed @ C:\Program Files\j2sdk_nb
    NetBeans installed @ C:\Program Files\j2sdk_nb\netbeans3.5
    When I start NetBeans using the desktop shortcut, I get IDE Alert "Cannot Load jvm.dll"
    Can anyone explain to me what I have done wrong and what I have to do in order to put it right.
    I found some stuff about editing 'paths to jvm.dll' but I have found 5 jvm.dll files... which one do I use?
    C:\Program Files\j2sdk_nb\_jvm\jvm.dll
    C:\Program Files\j2sdk_nb\_jvm\bin\classic\jvm.dll
    C:\Program Files\j2sdk_nb\_jvm\bin\hotspot\jvm.dll
    C:\Program Files\j2sdk_nb\_jvm\bin\server\jvm.dll
    C:\Program Files\Java\j2re1.4.2\bin\client\jvm.dll
    Can anyone help me get started getting started with Java?
    Thank you

    Hi
    I have just been suffering with the same problem and managed to find a solution based on answers in these very forums
    What worked for me was to add an entry into the ide.cfg file which told netbeans which folder my JDK was installed in.
    All you need to do is add the following line into the config file (which is in the bin folder under wherever you installed NetBeans 3.5) and it should start up (obviously you will need to change the folder name to match wherever you have your Java development kit)
    -jdkhome d:\JDK1.3
    Hope this works as well for you as it did for me
    Phil

  • How to load JVM without specifying jvm.dll

    How can I load JVM from native C++ code withoutknowing the path of jvm.dll?

    If on Windows, use the registry to find the place where the JRE has been installed. Take a look at the file java_md.c in the launcher subdirectory of the src.zip file supplied along with the JDK. Specifically, you will probably be most interested in the GetStringFromRegistry and GetPublicJREHome functions there.
    In the registry, look for the key HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment. That has a number of values you will probably want.
    If not on Windows, I really don't know how to find the location of the JRE installation without it being configured in an environment variable, or being hardcoded.
    Hope it helps.
    Cheers.

  • How to Dynamically Load jvm.dll without setting PATH

    Please help, invoking CreateJavaVM via a function pointer is returning -3, but I'm not sure why.
    When my PATH is setup up to include the jvm.dll and I invoke JNI_CreateJavaVM() directly, it works fine. But I want it to work regardless of my PATH setting, so I am trying to use LoadLibrary and dynamically load the jvm.dll and then a function pointer to invoke CreateJavaVM().
    The LoadLibrary returns non-NULL result, the GetProcAccress() returns non-null, but when I invoke the pointer to the CreateJavaVM call, it returns -3. I know -3 is JNI_EVERSION error, but any ideas what is wrong with the code below, such that it would give me this error?
    Currently my code is as follows:
    typedef jint (JNICALL CreateJavaVM_t)(JavaVM **pvm, void **env, void *args);
    JavaVM *m_jvm;
    JNIEnv *m_env;
    SetDllDirectory(L"C:\\Program Files\\Java\\jdk1.6.0_20\\jre\\bin\\client");
    HINSTANCE hVM = LoadLibrary(L"jvm.dll");
    if ( hVM == NULL ) {
       // report error
    CreateJavaVM_t *pfnCreateJavaVM = (CreateJavaVM_t*)GetProcAddress(hVM, "JNI_CreateJavaVM");
    #ifdef JNI_VERSION_1_6
    char cpChars[1024] = {0};
    sprintf_s(cpChars, "-Djava.class.path=%s", classPath); // classpath is defined elsewhere
    JavaVMOption options[1];
    options[0].optionString = cpChars;
    JavaVMInitArgs vm_args;
    vm_args.version = JNI_VERSION_1_6;
    vm_args.options = options;
    vm_args.nOptions = 1;
    vm_args.ignoreUnrecognized = JNI_TRUE;
    pin_ptr<JNIEnv*> env = &m_env;
    pin_ptr<JavaVM*> jvm = &m_jvm;
    int result = pfnCreateJavaVM(jvm, (void**)env, &vm_args);
    // This is where the failure occurs. result is -3 for some reason here...why?For some reason, pfnCreateJavaVM is returning -3, but I'm not sure why? Any ideas what is wrong with this code, such that it would give me a -3?
    Thanks in advance,
    Bill

    wkoscho wrote:
    For some reason, pfnCreateJavaVM is returning -3, but I'm not sure why? Any ideas what is wrong with this code, such that it would give me a -3?As an experiment try using a different jvm.dll from a different location. From my box there are several different jvm.dll under my jdk install dir.

  • Failed to load JVM.dll

    Hi
    I am trying to upload report templates in 8.1.1.3, but getting below error.
    SBL-EAI-05006: Failed to load the JVM Dll. Check that the specified dll name is correct.
    Object manager error: ([0] Failed to load the JVM Dll. Check that the specified dll name is correct.(SBL-EAI-05006) (0x23138e))
    SBL-OMS-00107: Object manager error: ([0] Failed to load the JVM Dll. Check that the specified dll name is correct.(SBL-EAI-05006) (0x23138e)).
    And I tried to set JVM DLL Name in profile configuration for XMLPSubSys component, and tried with all JVM dll file location paths in our server enviornment.
    also tried to find C:\PROGRA~1\Java\JDK15~1.0_0\jre\bin\server\jvm.dll unfortunately i didn't find this path.
    Can any one share the solution how can I create or set the correct path for above error?
    Thanks
    Sean

    Hi Sean,
    if you cannot find the path C:\PROGRA~1\Java\JDK15~1.0_0\jre\bin\server\jvm.dll manually, then it's clear that Siebel can also not find it.
    Make sure you have a supported JRE or JDK installed on your machine or on the Siebel server, and that the path is correct.
    In case of Siebel Web Client:
    * Java needs to be installed on the Siebel server
    * The DLL property of the named subsystem you mentioned must point directly to the jvm.dll file (e.g. C:\Program Files\Java\jre6\bin\client\jvm.dll)
    In case of Siebel Mobile/Developer Client:
    * Java needs to be installed on the client
    * The DLL property in the subsystem defined in the client's CFG file (e.g. siebel.cfg) must point directly to the jvm.dll file (e.g. C:\Program Files\Java\jre6\bin\client\jvm.dll)
    Benny

  • How to load external DLLs with C++ interface in TestStand?

    Hi,
    Can you please let me know how would I load external DLLs with C++ interface in TestStand?
    Regards.

    TestStand 3.x can only call static class C++ methods. TestStand cannot call methods on a C++ object because TestStand does not know how to enstantiate the C++ object.  In TestStand 3.x, there is a online help topic called "Exporting Class Methods and Functions in Visual Studio .NET".
    Scott Richardson
    National Instruments

  • Error loading jvm.dll - urgent!!

    Hi,
    When I try to compile using javac, I get an error as stated below:
    Error loading: y:\sys\nt\j2sdk-1_3_1\jre\bin\hotspot\jvm.dll
    What am I missing?
    Thanks

    check if jvm.dll exists in y:\sys\nt\j2sdk-1_3_1\jre\bin\hotspot. May not be a good solution but try to uninstall and re-install j2sdk. Also check ur CLASSPATH settings
    Vinay

  • Can't load jvm.dll in Vista

    I have a bizarre problem with JDK1.6.0_03 and Windows Vista. I am trying to compile and run a C program that calls a Java method, using the invocation API. In the past, this worked like a charm, provided I had c:\Program Files\Java\jdk1.6.0_03\jre\bin\client on the PATH.
    It no longer works. I get an error message that jvm.dll was not found and that Windows will notify me if it finds a solution to my problem. (I am not holding my breath.)
    I then try to load the library manually:
       HINSTANCE h = LoadLibrary("c:\\Program Files\\Java\\jdk1.6.0_03\\jre\\bin\\client\\jvm.dll");
       if (h == NULL)
           printf("Can't load library\n");
           exit(1);
         }I get the exact same error message.
    Did something break in Vista, or do I need to look elsewhere for a stupid configuration error?
    Thanks,
    Cay Horstmann

    Just in case some other poor soul gets to this, here is the way to implement the invocation under Windows Vista:
    #include <jni.h>
    #include <stdlib.h>
    #include <windows.h>
    typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **, JNIEnv **, JavaVMInitArgs *);
    int main()
       JavaVMOption options[2];
       JavaVMInitArgs vm_args;
       JavaVM *jvm;
       JNIEnv *env;
       long status;
       jclass class_Welcome;
       jclass class_String;
       jobjectArray args;
       jmethodID id_main;
       HINSTANCE h1, h2;
       CreateJavaVM_t createJavaVM;
       h1 = LoadLibrary("c:\\Program Files\\Java\\jdk1.6.0_03\\jre\\bin\\msvcr71.dll");
       if (h1 == NULL)
          printf("Can't load library msvcr71.dll\n");
          exit(1);
       h2 = LoadLibrary("c:\\Program Files\\Java\\jdk1.6.0_03\\jre\\bin\\client\\jvm.dll");
       if (h2 == NULL)
          printf("Can't load library jvm.dll\n");
          exit(1);
       options[0].optionString = "-Djava.class.path=.";
       memset(&vm_args, 0, sizeof(vm_args));
       vm_args.version = JNI_VERSION_1_2;
       vm_args.nOptions = 1;
       vm_args.options = options;
       createJavaVM = (CreateJavaVM_t) GetProcAddress(h2, "JNI_CreateJavaVM");
       status = (*createJavaVM)(&jvm, &env, &vm_args);
       if (status == JNI_ERR)
          printf("Error creating VM\n");
          return 1;
       class_Welcome = (*env)->FindClass(env, "Welcome");
       id_main = (*env)->GetStaticMethodID(env, class_Welcome, "main", "([Ljava/lang/String;)V");
       class_String = (*env)->FindClass(env, "java/lang/String");
       args = (*env)->NewObjectArray(env, 0, class_String, NULL);
       (*env)->CallStaticVoidMethod(env, class_Welcome, id_main, args);
       (*jvm)->DestroyJavaVM(jvm);
       return 0;
    }Compile with
    gcc -g -mno-cygwin -D __int64="long long" -I /cygdrive/c/Program\ Files/Java/jdk1.6.0_03/include/ -I /cygdrive/c/Program\ Files/Java/jdk1.6.0_03/include/win32/ -o InvocationTest InvocationTest.c Of course, in a real application, you'll want to dynamically locate the Java directory; look at launcher/java_md.c inside src.zip for inspiration.

  • Error Loading JVM.dll on WinNT

    Hi
    We have recently, installed Oracle Apps 11i. While applying a patch on Apps 11i, we were getting a Java error - Error Loading: ...\classic\jvm.dll. And we are unable to apply the Apps11i patch.
    I checked the entire Server for JVM.dll, but could not find it.
    After checking this forum, I found, that, a similar BUG in Java has been reported, but most of the BUG descriptions are for WIN 95 and WIN2K and NOT for WinNT.
    Could someone help me out.
    Enviroment Info:
    Product :- Oracle Apps 11i
    Platform :- WinNT 4.0
    Regards
    Vinod

    jvm.dll should be in the <java>\bin\classic directory.
    If it's not, then I THINK there's something wrong with your java runtime environment (jre).
    Is this something you installed yourself - the java - or was it soemthing dropped on yoour system by the Oracle product?
    o former: Get a new jre.
    o Latter: Get a new jre and/or complain to Oracle.

  • Error loading jvm.dll

    our company has an application that we use for company business that runs off Java.  Lately, I have several users that can no longer launch the application.   All are receiving the same error "The Java Runtime Environment cannot be loaded from <C:\PROGR~2\Oracle\JINITI~1.18\ bin\hotspot\jvm.dll>   We are running IE 10, Window 7 and latest version of Java. I did however try to use an older version of Java to no avail.  Any assistance will be greatly appreciated.

    jvm.dll should be in the <java>\bin\classic directory.
    If it's not, then I THINK there's something wrong with your java runtime environment (jre).
    Is this something you installed yourself - the java - or was it soemthing dropped on yoour system by the Oracle product?
    o former: Get a new jre.
    o Latter: Get a new jre and/or complain to Oracle.

  • Windows store app how to load a DLL in local directory or the SDcard

    The DLL is notpackaged together with APP,
    but by APP download from our company's Web site,
    and then placed the DLL
    in SDcard or a local directory.(DLL不是和APP一起打包,而是通过APP从公司网站上下载了相应的DLL然后放在SD卡中或APP本地目录中。)
    Question(问题)
    1、Windows store APP how
    to dynamically load a dll in
    a directory, and then call
    the interface of DLL?(APP如何能动态的加载并调用某一个目录中的DLL呢?)
    2、How to manually push a
    DLL into the phone?(如何手动把DLL放到手机中?)
    Can you share your code of a Demo?

    We do have
    such a demand:
    APP Test against
    many different devices, each device
    provides several  DLLs for APP
    to perform different tests,
    However,
    to the APP DLL interface
    is the same(such as: start()/end()...).
    To test
    a type of device, user need to download DLLs of the device
    from our website, the only way to support for test
    a device. When users
    download the DLLs for a device, then they can
    select the device
    for testing. At this
    time
    ,we can
    know the name of the DLLs   and load them.
    We support
    hundreds of devices, each device has a number of
    DLL files!!!
    we also do it on android and iOS.
    If can not achieve the
    requirements, we may have to give up
    the windows platform

Maybe you are looking for

  • Is There A Way for Windows Outlook to SEE & RESPONSE to iCal/Mail's Invites

    Hello all. I apologised first for sending out a similar topic again so soon. I "was" using Mail and iCal in the office and the 'rest' of my 90% colleagues are on PCs with Windows Outlook. When I create a new event in iCal and send an invite either by

  • FIRMWARE ISSUES WITH CREATIVE ZEN V P

    What is going on?!?!! Just about every other thread i've read on here somebody has my same problem: ) My Zen V Plus was not recognized by my computer and it was always stuck on "rebuilding library" when i turned it on but when it got halfway through,

  • Problem with posting goods receipt

    Hi Gurus, My PO is created for a material  with quantity 45000 nos. Overdelivery tolerance is 20%. Already GR is posted for 48000 nos and MIRO is posted for the same. Now, I want to post GR for the remianing qty ie. (45000*1.2) - 48000 = 6000 nos. Wh

  • Synching Verizon Inbox to Iphone 5

    I can delete mail from my device...and it is removed from inbox.  When i delete from inbox it does not remove for phone.  All settings are correct as i can see and updates were made according to instructions sent.  Can this not be done?

  • Purchased LR5 download from ebay, from adobe, where is it? and the serial number?

    it says its "on it's way".  why is it on its way? its a direct download? i have a mac btw