Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #7129

Re: JNI accessing a class that instantiates another class

From Florian Weimer <fw@deneb.enyo.de>
Newsgroups comp.lang.java.programmer
Subject Re: JNI accessing a class that instantiates another class
Date 2011-08-15 21:50 +0200
Message-ID <87vctyxxlt.fsf@mid.deneb.enyo.de> (permalink)
References <d48afffd-0ff8-4cc4-a63b-45ffe01224e9@o11g2000yql.googlegroups.com> <871uwma9kd.fsf@mid.deneb.enyo.de> <391b55eb-b8cc-413e-9c58-21ce7e81b934@v7g2000vbk.googlegroups.com>

Show all headers | View raw


* Danno:

> Thank you for taking the time to reply to my post.  I have attached my
> code below.  I have not used -Xcheck:jni before.  I may not fully
> understand how to use it, but the way I understand it, it is a command
> line argument.  The java program, however, is not being called from a
> command line.  I have a MicroFocus COBOL program that is calling a C++
> dll that starts a JVM and invokes a Java method via JNI.  Is there a
> way to run -Xcheck:jni under that scenario?

The JVM cannot be linked into all processes as a library, at least on
UNIX-like platforms.  I'm not sure if Windows is different in this
regard.  In your case, the JVM does not seem to properly support
exception handling.

There are options that supposedly increase compatibility, see the JVM
documentation.

>         options[0].optionString = "-Djava.class.path=.";

I think you have to put "-Xcheck:jni" here, as an additional option.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

JNI accessing a class that instantiates another class Danno <danmwall-google@yahoo.com> - 2011-08-15 07:55 -0700
  Re: JNI accessing a class that instantiates another class Florian Weimer <fw@deneb.enyo.de> - 2011-08-15 19:06 +0200
    Re: JNI accessing a class that instantiates another class Danno <danmwall-google@yahoo.com> - 2011-08-15 12:28 -0700
      Re: JNI accessing a class that instantiates another class Florian Weimer <fw@deneb.enyo.de> - 2011-08-15 21:50 +0200
  Re: JNI accessing a class that instantiates another class Roedy Green <see_website@mindprod.com.invalid> - 2011-08-15 15:10 -0700

csiph-web