Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Test and Performance Tools Platform (TPTP) » Eclipse JNI help?
icon14.gif  Eclipse JNI help? [message #519029] Fri, 05 March 2010 13:54 Go to next message
Mark Cheung is currently offline Mark Cheung
Messages: 18
Registered: July 2009
Junior Member
Hi,

so I try calling a method (C) in my jni library for testing.

The java method is as followed:
public void call()
{
System.out.println("testing 3");
Hello h = new Hello();
h.sayHello();
System.out.println("testing 3 passed");
}

//File: Hello.c
#include <jni.h>
#include "Hello.h"
#include <stdio.h>
JNIEXPORT void JNICALL Java_test_Hello_sayHello
(JNIEnv *env, jobject obj)
{
printf("Hello world!\n");
return;
}

However, it seems that h.sayHello method is called only after I closed the plug-in.
print-out:
testing 3
testing 3.5 passed
testing 4 passed
passed
Hello world! ....

How can I call it without closing the plug-in?

Thanks,
MC
Re: Eclipse JNI help? [message #519419 is a reply to message #519029] Mon, 08 March 2010 13:34 Go to previous message
Eugene Chan is currently offline Eugene Chan
Messages: 287
Registered: July 2009
Senior Member
Hi Mark,

This newsgroup is for TPTP profiling questions/discussion only. I suggest
you try report to the JDT/CDT newsgroup.

Eugene

"Mark Cheung" <iammark1237@yahoo.com> wrote in message
news:hmrk1i$uv1$1@build.eclipse.org...
> Hi,
>
> so I try calling a method (C) in my jni library for testing.
> The java method is as followed:
> public void call()
> {
> System.out.println("testing 3");
> Hello h = new Hello();
> h.sayHello(); System.out.println("testing 3 passed");
> }
>
> //File: Hello.c
> #include <jni.h>
> #include "Hello.h"
> #include <stdio.h>
> JNIEXPORT void JNICALL Java_test_Hello_sayHello
> (JNIEnv *env, jobject obj)
> {
> printf("Hello world!\n");
> return;
> }
>
> However, it seems that h.sayHello method is called only after I closed the
> plug-in. print-out:
> testing 3
> testing 3.5 passed
> testing 4 passed
> passed
> Hello world! ....
>
> How can I call it without closing the plug-in?
>
> Thanks,
> MC
Previous Topic:TPTP profiling timeout error
Next Topic:how to view object allocation/references within a class
Goto Forum:
  


Current Time: Mon Sep 01 14:36:27 EDT 2014

Powered by FUDForum. Page generated in 0.01966 seconds