Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Roedy Green Newsgroups: comp.lang.java.programmer Subject: Re: JNI accessing a class that instantiates another class Date: Mon, 15 Aug 2011 15:10:57 -0700 Organization: Canadian Mind Products Lines: 31 Message-ID: References: Reply-To: Roedy Green NNTP-Posting-Host: RCd/Ul4tyxGUBII8WGwa5g.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Forte Agent 6.00/32.1186 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7130 On Mon, 15 Aug 2011 07:55:50 -0700 (PDT), Danno wrote, quoted or indirectly quoted someone who said : > The only problem is, when >the Java class attempts to create an instance of this second, inner >class, it dies. I don't get an error, it just doesn't work. This why JNI is so difficult. The Java trace will not follow the code through it. Is there anything that will do that? My rule of thumb is to do everything in Java you possibly can, and do only in C++ what you can't do in Java. You might consider creating the object in Java and passing it in as a reference. To handle it the way you want, however, create a test program that does absolutely nothing else but create a Java object in JNI. That way you get all distractions out the way. Also scan the net for sample code that creates Java objects in C++ to see if there is some catch. If you don't have a textbook, get one. Almost nothing about JNI is obvious. see http://mindprod.com/jgloss/jni.html -- Roedy Green Canadian Mind Products http://mindprod.com Most of computer code is for telling the computer what do if some very particular thing goes wrong.