[Kde-java] Re: GCJ (Re: Build system for KDE4)

Richard Dale Richard_Dale at tipitina.demon.co.uk
Thu Jun 16 06:36:03 CEST 2005


On Wednesday 15 June 2005 21:23, Martijn Klingens wrote:
> On Wednesday 15 June 2005 18:07, Tom Tromey wrote:
> > CNI isn't really a full C++/Java bridge.  There doesn't seem to be a
> > good way to make one, really, since C++ is so much more expressive
> > than Java.
> >
> > CNI is more like a convenient way to write native methods in C++, and
> > a way to access Java code from C++.
>
> Ok, to make sure that I get it right: if I have a C++ lib and want to write
> Java unit tests I would first need to wrap the C++ lib? That'd be a rather
> large setback for me.
If a qtjava method returns an instance that was allocated in the C++ world, it 
will create a new java instance to wrap it. So as long as you only need java 
classes which are defined in the bindings in the test driver, that will work. 
But if you have your own C++ classes, and want to call methods on them that 
aren't in the java bindings, then you would have to write your own bindings 
for those classes.

> Also, the other way round, writing a lib in Java and the tests in C++ would
> be far more simple? (As that's exactly the case I do *NOT* need it's
> useless for me, but trying to get things straight.)
Easier to do in CNI than JNI, but the java bindings don't really to anything 
to help with that case.

-- Richard


More information about the Kde-java mailing list