I can't create the JVM using JNI_CreateJavaVM

I'm very much new to the JNI on Windows 2000. When I compiled the example invoke.c program that invoke the java program, it generated invoke.exe file. but when I run the this executable file, it always shows "Can't create Java VM". I tried other samples, but the result is same. I am also sure that I copy jvm.dll from jdk1.2.2\jre\bin\classic to the same folder with invoke.exe file.
I use JDK1.2.2 and Microsoft Visual Studio 6.0 C++. Please let me know what's going on about the following program?
#include <jni.h>
#define USER_CLASSPATH "." /* where Prog.class is */
int main() {
JNIEnv *env;
JavaVM *jvm;
jint res;
jclass cls;
jmethodID mid;
jstring jstr;
jclass stringClass;
jobjectArray args;
JavaVMInitArgs vm_args;
JavaVMOption options[1];
options[0].optionString =
"-Djava.class.path=" USER_CLASSPATH;
vm_args.version = JNI_VERSION_1_2;
vm_args.options = options;
vm_args.nOptions = 1;
vm_args.ignoreUnrecognized = JNI_TRUE;
/* Create the Java VM */
res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
if (res < 0) {
fprintf(stderr, "Can't create Java VM\n");
exit(1);
cls = (*env)->FindClass(env, "Prog");
if (cls == 0) {
goto destroy;
mid = (*env)->GetStaticMethodID(env, cls, "main",
"([Ljava/lang/String;)V");
if (mid == 0) {
goto destroy;
jstr = (*env)->NewStringUTF(env, " from C!");
if (jstr == 0) {
goto destroy;
stringClass = (*env)->FindClass(env, "java/lang/String");
args = (*env)->NewObjectArray(env, 1, stringClass, jstr);
if (args == 0) {
goto destroy;
(*env)->CallStaticVoidMethod(env, cls, mid, args);
destroy:
if ((*env)->ExceptionOccurred(env)) {
(*env)->ExceptionDescribe(env);
(*jvm)->DestroyJavaVM(jvm);
return 0;

Are you sure you are using the correct jvm.dll?
Remove any jvm.dll files you copied to your .exe directory and set your Path so that is using the jdk1.3 hotspot jvm.dll.
You said you were using windows so the default location of your jdk is C:\jdk1.3.1 To set your path to the correct location use this command:
set Path=%Path%;C:\jdk1.3.1\jre\bin\hotspot
If your jdk is installed somewhere else replace C:\jdk1.3.1 with the root path to your jdk.
If that doesn't work there may be a conflict with the way you compiled the program.

Similar Messages

  • Can we create the Purchase order that using P&L account or just using account do not use cost center.

    Dear Experts,
    Could you please advise :
    1) Can we create the purchase order that using profit and loss account ? ( if yes , which kind of account assignment category we should use ?)
    2) How to create a purchase order for service charge .( just using GL account )
    Thanks & Best Regards,
    Watson

    Hi,
       May I know why you do not use cost center for consumption?
       You may create a new account assignment category in OME9 by copying K and maintain the cost center as optional. Please note that you have to maintain the item category blank and the account assignment category combination in OMG0. Now, you can use a GL account in PO which doesnt require a cost center assignment (in OBC4 against the field status group of the GL)
       You may use the same account assignment category created in the previous step with item category D, after you maintain the combination of the account assignment with item category D in OMG0.
        Please test the scenario and revert back.
    Regards,
    AKPT

  • HT5071 Can I create a book using the IBooks Author word processing software, save it as a PDF, then have it professionally printed by an offset press to sale in brick and mortar stores? If so, is this procedure free me from any IBooks restrictions?

    Can I create a book using the IBooks Author word processing software, save it as a PDF, then have it professionally printed on an offset press to sale in brick and mortar stores? If so, is this procedure free from any IBooks restrictions?

    It's your content, under your control.
    If you output as an .ibooks file, and you want to sell it, the store is the only outlet, otherwise, you can do as you wish.

  • Can not create the connection in the enrironment!!

    hello,every one:
    please see the following code:
              Environment *env = Environment::createEnvironment(Environment::OBJECT);
              Connection *conn = env->createConnection(userName,password,connectString);
    try
    //use the conn
              catch (SQLException &ex)
                   env->terminateConnection(conn);
                   Environment::terminateEnvironment(env);
                   throw;//re-throw
              env->terminateConnection(conn);
              Environment::terminateEnvironment(env);
              Environment *ev = Environment::createEnvironment(Environment::OBJECT);
    //the program stopped here,display i can not create the new connection
              Connection *cn = ev->createConnection(userName,password,connectString);
              ev->terminateConnection(cn);
              Environment::terminateEnvironment(ev);
    I have terminated the connection and the environment,then why I can not create the
    connection in the new environment?
    I have tried several times,if you connect the same database as the former,then it
    does not work,but if you connect a new database ,it can create the new connection!
    plus:I don't want to use conection pool .
    Can I have some method to solve the problem?
    Please help me!
    Thanks a lot in advance!
    tony from China

    Hi Tony,
    This similar sample works perfectly fine for me. Can you
    retry with this?
    #include <iostream>
    #include <occi.h>
    using namespace std;
    using namespace oracle::occi;
    int main()
            Environment *env = Environment::createEnvironment(Environment::OBJECT);
            Connection *conn = env->createConnection("scott","tiger","inst1");
            try
            //use the conn
            catch (SQLException &ex)
                    env->terminateConnection(conn);
                    Environment::terminateEnvironment(env);
                    cout<<ex.getMessage();
            env->terminateConnection(conn);
            Environment::terminateEnvironment(env);
            Connection *cn;
            Environment *ev;
            try{
            ev = Environment::createEnvironment(Environment::OBJECT);
            cn = ev->createConnection("scott","tiger","inst1");
            catch (SQLException &ex)
                    ev->terminateConnection(cn);
                    Environment::terminateEnvironment(ev);
                    cout<<ex.getMessage();
            ev->terminateConnection(cn);
            Environment::terminateEnvironment(ev);
    }Rgds
    Amogh

  • How can i create the exceptions in query

    Hi Firends,how can i create the exceptions for key figures and charectristics and how can can i assign the colours and when we will create the variables for exceptions..
    please let me know..
    Assign Points surely..
    regards

    Hi,
    Not sure i understnad your request 100%, but exceptions for key figures are created as explained in http://help.sap.com/saphelp_nw04/helpdata/en/68/253239bd1fa74ee10000000a114084/content.htm
    and
    http://help.sap.com/saphelp_nw04/helpdata/en/1a/615f64816311d38b170000e8284689/content.htm
    Assign points if useful,
    Xibi

  • How can i create splash screen using netbean?

    how can i create splash screen using netbean?

    Welcome to the Sun forums.
    gabbyndu wrote:
    how can i create splash screen..Java 6 offers a splashscreen functionality. See [New Splash-Screen Functionality in Java SE 6|http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/splashscreen/] *(<- link)* for details.
    [Java Web Start|http://java.sun.com/javase/technologies/desktop/javawebstart/index.jsp] has offered splash screens to applications since Java 1.2. See [How can I provide my own splash screen?|http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/faq.html#206] in the JWS FAQ for more details.
    .. using netbean?We don't support Netbeans here. Ask that on a [Netbeans forum|http://forums.netbeans.org/].

  • How Can I create the new security answers?

    How Can I create the new security answers?

    Read this about how to change the security questions: http://support.apple.com/kb/HT5312
    If you can't use these procedures contact Apple. See http://support.apple.com/kb/HT5699

  • Can I change the JVM running in JServer

    I have set up a 8.1.5 database with the jserver option.
    I have tried to load some java stored procedures into this database. Some of these fail because of unresolved errors for things like an iterator.
    I can see why the resolution error is happening. That is my code uses jdk1.2 features, wheres as the jserver seems to be running the 1.1 java.
    My question is: is there a way to change the jdk version being run by jserver? or is this version fixed by oracle?
    I have used oracle 8.1.6 and this seems to work fine i.e. jserver runs java 1.2 libraries and everything loads and runs fine.

    Nope, you can't change the JVM. It's part of the Oracle kernel itself (like PL/SQL)
    null

  • Can we create the two conatiners fscm (9.0) and hcm 9.1 into one execution

    Hi ,
    can we create the of the different (peoplesoft)adaptors into one execution plan.
    i cretaed the two conatiners from psft-fscm 9.0 and psft-hcm 9.1
    ,create one execution plan ,get the parameters then build getting the follwing error.
    HR Workforce 9.1 with FSCM 9.0MESSAGE:::For Node SDE_PSFT_Stage_InternalOrganizationDimension_CompanyHierarchy_DeriveRange(DataWarehouse_HR->DataWarehouse_HR) there are conflicting folder informations from this execution plan
    SDE_PSFT_90_Adaptor and SDE_PSFT_91_Adaptor
    Please set the priorities for the physical folder (lower priority gets higher preference).
    EXCEPTION CLASS::: com.siebel.analytics.etl.execution.ExecutionPlanInitializationException
    com.siebel.analytics.etl.execution.ExecutionPlanDesigner.design(ExecutionPlanDesigner.java:1321)
    com.siebel.analytics.etl.client.util.tables.DefnBuildHelper.calculate(DefnBuildHelper.java:169)
    com.siebel.analytics.etl.client.util.tables.DefnBuildHelper.calculate(DefnBuildHelper.java:119)
    com.siebel.analytics.etl.client.view.table.EtlDefnTable.doOperation(EtlDefnTable.java:172)
    com.siebel.etl.gui.view.dialogs.WaitDialog.doOperation(WaitDialog.java:53)
    com.siebel.etl.gui.view.dialogs.WaitDialog$WorkerThread.run(WaitDialog.java:85)
    we are using
    DAC 10.1.3.4
    Informatica 9.0.1
    peoplesoft 90 and 91 adaptors
    thanks in advance...
    Regards,
    sairam....

    Hi All,
    Please Update the Thread
    Regards
    Khanna

  • Can I create Oracle Database using Java ???

    HI ...
    Can I create a Database using Java... ? If yes can any one tell me how ? I mean provide some codeing help... ???

    If you mean a table yes, since the create table statement is exactly that, an SQL statement, if you mean an SID then I would have to say (AFAIK) no.

  • Can Dreamweaver create the remote root directory?

    Hi,
    Does Dreamweaver have the capability to create the remote
    root directory? As an example, if I define a remote site and I set
    the host directory to public/site3 where the public directory
    already exists on the server but site3 directory does not, can
    Dreamweaver create the site3 folder? Other programs will notify
    that the directory does not exist and ask if you'd like for it to
    be created. Dreamweaver just seems to give me error messages.
    I'm currently using a straight FTP program to create the
    directory before I define the remote site but it seems ridiculous
    to have to do this.
    Thanks!
    Julie

    > can Dreamweaver create the site3 folder?
    Sure.
    But - what do you expect this to do for you? Are you trying
    to have
    multiple sites on a single hosting account?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "[email protected]"
    <[email protected]> wrote in message
    news:fbutc7$88f$[email protected]..
    > Hi,
    >
    > Does Dreamweaver have the capability to create the
    remote root directory?
    > As
    > an example, if I define a remote site and I set the host
    directory to
    > public/site3 where the public directory already exists
    on the server but
    > site3
    > directory does not, can Dreamweaver create the site3
    folder? Other
    > programs
    > will notify that the directory does not exist and ask if
    you'd like for it
    > to
    > be created. Dreamweaver just seems to give me error
    messages.
    >
    > I'm currently using a straight FTP program to create the
    directory before
    > I
    > define the remote site but it seems ridiculous to have
    to do this.
    >
    > Thanks!
    > Julie
    >

  • How can I Improve the Performance using Global Temo Tables ??

    Hi,
    Can anyone tell me , How can i make use of Global Temporary Tables to improve the Performance.
    I have few sample scripts ,
    Say i have the View based on some Complex query like ,
    CREATE OR REPLACE VIEW Profile_values_view AS
    SELECT d.Profile_option_name, d.Profile_option_id, Profile_option_value,
    u.User_name, Level_id, Level_code
    FROM Profile_definitions d, Profile_values v, Profile_users u
    WHERE d.Profile_option_id = v.Profile_option_id
    AND ((Level_code = 'USER' AND Level_id = U.User_id) OR
    (Level_code = 'DEPARTMENT' AND Level_id = U.Department_id) OR
    (Level_code = 'SITE'))
    AND NOT EXISTS (SELECT 1 FROM PROFILE_VALUES P
    WHERE P.PROFILE_OPTION_ID = V.PROFILE_OPTION_ID
    AND ((Level_code = 'USER' AND
    level_id = u.User_id) OR
    (Level_code = 'DEPARTMENT' AND
    level_id = u.Department_id) OR
    (Level_code = 'SITE'))
    AND INSTR('USERDEPARTMENTSITE', v.Level_code) >
    INSTR('USERDEPARTMENTSITE', p.Level_code));
    Now i have created the Global temp Table as ,
    CREATE GLOBAL TEMPORARY TABLE Profile_values_temp
    Profile_option_name VARCHAR(60) NOT NULL,
    Profile_option_id NUMBER(4) NOT NULL,
    Profile_option_value VARCHAR2(20) NOT NULL,
    Level_code VARCHAR2(10) ,
    Level_id NUMBER(4) ,
    CONSTRAINT Profile_values_temp_pk
    PRIMARY KEY (Profile_option_id)
    ) ON COMMIT PRESERVE ROWS ORGANIZATION INDEX;
    Now I am Inserting the Records into Temp table as
    INSERT INTO Profile_values_temp
    (Profile_option_name, Profile_option_id, Profile_option_value,
    Level_code, Level_id)
    SELECT Profile_option_name, Profile_option_id, Profile_option_value,
    Level_code, Level_id
    FROM Profile_values_view;
    COMMIT;
    Now what my doubt is, when do i need to execute the Insert Statement.
    Say , if the View returns few millions of records , then loading such a data into Global Temporary table takes lot of time.
    Then what is the use of Global Temporary tables and how can i improve the Performance using the same.
    Raj

    Thanks for the responce ,
    There are 2 to 3 complex views in our database, and there always be more than 5000+ users will be workinf on the application and is OLTP application. Those complex views are killing the application performance.
    I what i felt was, if i create the Global Temporary tables for thow views and will be able to load the one third million of records returned by the views in to cache and can improve the application performance.
    I have created the Global Temporary tables for 2 views with the option On Commit Preserve , But after am inserting the records into the Temp table and when i Issue the commit statement, the Temp table is getting Cleared.
    I really got surpised of this behaviour as i know that with the Option On Commit Preserve , the rows should retain in the Temp Table, Instead , it's getting cleared.
    Pelase suggest , what to do ??
    Raj

  • What's the fix for this error: Can't create the file "feed.xml."

    I try to publish my site from iWeb but I get an error which is below.
    Publish Error
    Can’t create the file “feed.xml.” The disk may be damaged or full, or you may not have sufficient access privileges.
    Anyone know the fix?

    Whether 'feed.xml' is the first file it is trying to upload, indicating a general failure to connect, or whether it's choked at that particular point would be the question. It would be worth your getting an FTP program if you don't already have one - Cyberduck is free - and checking whether any files at all have been uploaded.
    Is this the first time you've tried to publish or are you updating an existing site? If it's the first you should check carefully that your settings are correct, in particular the 'path' which varies between different hosts and may be blank or may be something like 'public.html' or 'htdocs' - this would lead to the actual webspace which may not be the root level as you access the FTP server.
    You could also try publishing to a local folder - create a special folder somewhere and specify it when setting iWeb to do this, check the contents are OK, then upload the contents of the folder (not the folder itself) using Cyberduck.

  • Can't create the file "shapeimage_21.png."

    Hi,
    I am one of those people who still use iWeb...Recently I received the following message.  Publish Error Can't create the file "shape image_21." The disk may be damaged or full, or you may not have sufficient access privileges.  I did manage to get to iWeb's Library...but don't see a shape image_21.  I did remove 3 shape images but that didn't do it either. 
    What do I do?
    Please help....first time I've had problems with iWeb...like to continue...
    running on Yosemite imac

    Try the following:
    1 - delete the iWeb preference file, com.apple.iWeb.plist, that resides in your
         User/Home/Library/ Preferences folder.
    2 - delete the contents of the User/Home/Library/Caches/com.apple.iWeb folder
    3 - launch iWeb and try again.
    NOTE: In Lion and Mountain Lion the Home/Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and press the Return key - 10.7: Un-hide the User Library folder.
    If you're running Mavericks or Yosemite  go to your Home folder and use the View ➙ Show View Options menu to bring the this window:

  • Creating the WBS using bapis

    i am creating the WBS using thses bapis
    1. BAPI_PS_INITIALIZATION
    2. BAPI_BUS2001_CREATE
    3. BAPI_PS_PRECOMMIT
    4. BAPI_TRANSACTION_COMMIT/BAPI_TRANSACTION_ROLLBACK
    but i am getting the error
    Field COMPANY_CODE/Company code: Changing the contents of the field is not permitted
    Field BUSINESS_AREA/Business area: Changing the contents of the field is not permitted 
    Field WBS_ACCOUNT_ASSIGNMENT_ELEMENT/Acct asst elem.: Changing the contents of the field is not permitted         
    Field OBJECTCLASS/Object Class: Changing the contents of the field is not permitted     
    Please help to resolve this
    kanishak

    Hi,
    have you tried to look for corresponding OSS notes? I've never had any problems with this BAPI and according to BAPI documentation all fields from input structure can be used. It looks more like error. Or don't you have any validation for projects definitions? If you can find the reason you can still debug that code and see why it's failing.
    BTW your BAPI is for Project definition creation, not WBS element. You can maintain WBS elements form any project using BAPI BAPI_PROJECT_MAINTAIN.
    Cheers

Maybe you are looking for

  • Error in query running.

    when i am running a query i am getting this error  in WAD: "Value 'SPEED STICK DEO REG (1dz)' (hex. '0053005000450045004400200053005400490043004B002000') of characteristic 0CP_TEXT contains invalid characters", I tried to run the same query in RSRT,

  • How do I create a group of channels for input to a AI multi point

    Hi,     How do I create a group of channels for input to a AI multi point, so that I can output it to 3 different graphs.I figured out the graphs but I am not able to figure out how to create the group of channels for the input.I saw many examples wh

  • Robohelp 7- Flashhelp

    Hello, I am currently using Robohelp 7 version. I am now trying to generate a FlashHelp help file. After I generate a layout and test the help file on the same PC it works good, but when I copy the entrie folder (help file) and try to test it another

  • Partition Exchange Swapping the data instead of Increment

    can somebody help me with the below scenerio: I have two tables stg_dim and final_dim table. It is working for first time loading but when i load second time into same partition swapping the data between two tables. For example : first time i loaded

  • Form Processor Pro

    I'm looking into purchasing Form Processor Pro 5.0 for my forms. Has anyone used this. Any feedback appreciated before I purchase. Thanks Lynne