This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Calling a Java function from C++ using CNI


> > I don't believe this is true.
> 
> Believe it.  Why do you ask a question, and don't believe people who
> have a lot more experience than you?  I suggest you read the link
> Ranjit gave.

Please accept my apologies. I acted too hastily.

> > Since the Java source is compiled to
> > native code, there's no need to create a VM as there is no byte code
> > to interpret.
> 
> Ranjit didn't write "VM", he wrote "runtime".  It does need to be
> initialized.

Yes, but the function is called JvCreateJavaVM, which is clearly
misleading. I have no intention of creating a VM. I therefore believed
the link did not apply to me. May I suggest JvCreateJavaRuntime? That
I would have believed.

> Now we could be more clever have have the runtime be automatically
> be initialized, by various places checking to see if it has been
> initialized, and if not, automatically calling the necessary routines.
> 
> Whether that would be a good idea could be discussed.  But for now
> the runtime must be explicitly initialized.

I've read that object creation and static function calls check to see
that the class has been initialized first. Perhaps at this same point
the system could check that the runtime has been initialized.

Cheers,
Shaun


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]