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: GCJ and C++ (calling Java from C++)


Lothar Werzinger writes:
 > On Tuesday 29 November 2005 09:42, Andrew Haley wrote:
 > > The first thing in Section 12.15, Invocation, is:
 > >
 > > Function: jint JvCreateJavaVM (JvVMInitArgs* VM_ARGS)
 > >      Initializes the Java runtime
 > >
 > > Did you call that?
 > >
 > > Did you do everything in 12.15.2, Example?
 > 
 > Well it seems you did not get a chance to look at the example I attached in 
 > the first mail. However to make things short, this is the code I use:

Right.  I look now, and I see a compressed tar file at the end of your
message.  I never noticed it before...

But I still can't see how you build this stuff.

 > I even get the (lengthy and thus omitted) output from the call to the static 
 > LibraryTest::printlibrary(p_libraryTest); call.
 > 
 > I get the exception when I call p_library->getBooks();
 > 
 > I also tried to move the JvInitClass(&Library::class$); call above the 
 > p_libraryTest->getlibrary(); call, but the the p_libraryTest->getlibrary(); 
 > call fails with this exception.
 > 
 >      [exec] Caused by: java.lang.NullPointerException
 >      [exec] at java.lang.VMClassLoader.resolveClass(java.lang.Class) 
 > (/usr/lib64/libgcj.so.6.0.0)

That NullPointerException is the clue.  It's happening when some class
is being resolved, and it's probably being casued by some sort of
linking problem.

(I was guessing that you weren't calling JvCreateJavaVM(), which would
cause this problem.  But you are, so it's not that.)

 >      [exec] ...4 more
 > 
 > So I am a kind of stuck here :-(

Forgive me if I still can't see something obvious, but I really do need to know
how you built this program.

Andrew.


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