public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bryce McKinlay <bmckinlay@gmail.com>
To: "java@gcc.gnu.org" <java@gcc.gnu.org>
Cc: Bucher Fabio <fabio.bucher@ntb.ch>
Subject: Re: create an object with cni
Date: Mon, 24 Jun 2013 12:28:00 -0000	[thread overview]
Message-ID: <CALUNu-r9t7jfO6iV0AbYzgjFXkecaO_rVJ=x_7C19RyzYtXVsw@mail.gmail.com> (raw)
In-Reply-To: <17B34E365AFABC468216733E4B4CC75492AD806B@mail-server.ntb.ch>

On Mon, Jun 24, 2013 at 1:17 PM, Bucher Fabio <fabio.bucher@ntb.ch> wrote:
> Thank you, I can run this example and I put my code in there. Which is the right namespace to use, and which Class do I have to load with the JvInitClass()-method?

The namespace corresponds directly to the package name in Java. e.g.
"java.util" becomes "java::util". If your java class has no package
name then you don't need any namespace.

> Now the error message says:
> Test.cc:20:29: error: expected primary-expression before »)« token
> Test.cc:21:29: error: typ specification expected
> Test.cc:21:29: error: Java-object test is not with new allocated
> Test.cc:21:29: error: »,« or »;« expected
>
> Do I have to load my Java-class with the JvInitClass()-method? I think yes, but how is it done the right way?

Actually, no, you don't need to bother with JvInitClass in this case,
because calling "new" will ensure that it is initialised
automatically. The example only needs the JvInitClass() call because
it is accessing a static Java variable, System.out.

The correct syntax to reference your class would be:

&Java_with_CNI::class$  (This is the CNI equivalent of
"Java_with_CNI.class" in Java.)

Bryce

  reply	other threads:[~2013-06-24 12:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-24 12:17 Bucher Fabio
2013-06-24 12:28 ` Bryce McKinlay [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-06-24 12:54 Bucher Fabio
2013-06-24  9:37 Bucher Fabio
2013-06-24 10:27 ` Bryce McKinlay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALUNu-r9t7jfO6iV0AbYzgjFXkecaO_rVJ=x_7C19RyzYtXVsw@mail.gmail.com' \
    --to=bmckinlay@gmail.com \
    --cc=fabio.bucher@ntb.ch \
    --cc=java@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).