From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15577 invoked by alias); 24 Jun 2013 12:28:57 -0000 Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org Received: (qmail 15566 invoked by uid 89); 24 Jun 2013 12:28:56 -0000 X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-wi0-f176.google.com (HELO mail-wi0-f176.google.com) (209.85.212.176) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 24 Jun 2013 12:28:56 +0000 Received: by mail-wi0-f176.google.com with SMTP id ey16so2483874wid.3 for ; Mon, 24 Jun 2013 05:28:54 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.107.163 with SMTP id hd3mr5848997wib.13.1372076934016; Mon, 24 Jun 2013 05:28:54 -0700 (PDT) Received: by 10.194.83.194 with HTTP; Mon, 24 Jun 2013 05:28:53 -0700 (PDT) In-Reply-To: <17B34E365AFABC468216733E4B4CC75492AD806B@mail-server.ntb.ch> References: <17B34E365AFABC468216733E4B4CC75492AD806B@mail-server.ntb.ch> Date: Mon, 24 Jun 2013 12:28:00 -0000 Message-ID: Subject: Re: create an object with cni From: Bryce McKinlay To: "java@gcc.gnu.org" Cc: Bucher Fabio Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2013-06/txt/msg00006.txt.bz2 On Mon, Jun 24, 2013 at 1:17 PM, Bucher Fabio wrote: > Thank you, I can run this example and I put my code in there. Which is th= e right namespace to use, and which Class do I have to load with the JvInit= Class()-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 =BB)=AB 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: =BB,=AB or =BB;=AB expected > > Do I have to load my Java-class with the JvInitClass()-method? I think ye= s, 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