Link to home
Start Free TrialLog in
Avatar of jalgazi
jalgazi

asked on

JNI Question. C/C++ to Java (creating a JVM)

I am having a problem creating a JVM from C/C++.  I am getting an error code of -1 when I call JNI_CreateJavaVM(...) API from C.

I am using jdk1.1.3 ->
I am setting:

JDK1_1InitArgs vm_args;
vm_args.version = JNI_VERSION_1_2;

I think the problem might have to do with my classpath.
vm_args.classpath = ???

I'm not sure what my class path should be.  I tried many different things.  I put my .class java file in the c:\ directory and set the classpath to c:\, but it didn't work.

Does anyone have any suggestions!

Thank you.  jcast17


ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jalgazi
jalgazi

ASKER

Could you please be a little more specific.

Do I need to include rt.jar... I tried copying the above  code you gave me, but I am still unsuccesful
.
I am don't know much when it comes to this stuff.

I have seem examples that say I should include.

".;c:\\jdk1.3.1\\jre\\lib\\rt.jar;c:\\prog.class"


thanks, jcast17.
Dear jalgazi

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "jkr"

comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points. The link to the Community Support area is: https://www.experts-exchange.com/commspt/

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
Force accepted

** Mindphaser - Community Support Moderator **