Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Content Assist for Java Native Interface
Content Assist for Java Native Interface [message #212852] Thu, 27 March 2008 10:24 Go to next message
Eclipse UserFriend
Originally posted by: Lulin.Song.gmail.com

Hi,

I am working on a project which involves Java, C and Fortran all together.
When I opened .c file using Java Editor, the content assist (Ctrl-Space)
didn't show Java Native Interface API. It said 'no default proposals'. I
tried open .c file using C Editor. The same happened. But Content assist
works when I opened a .java file.

Anyone know how to fix it?

Thanks,
Re: Content Assist for Java Native Interface [message #213025 is a reply to message #212852] Sat, 29 March 2008 21:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rhildred.users.sourceforge.net

Hi:

I think that I am trying to do something similar, but it sounds like you
are a little further along than me. I have cni code as well, c++ and java,
that I am compiling to native using gcj. My code runs, and I can trace
through it in gdb. When I try to trace in the cdt it won't go in to .java
files or go to breakpoints. By this I mean that if I set a breakpoint in
my .gdbinit like so:

handle SIGPWR nostop noprint
handle SIGXCPU nostop noprint
break Hello.main

its stops there, and I see the stack in my debug perspective, but it won't
show my sourcefile. When I set the breakpoint in my c++ perspective in the
java file it doesn't break there.

Even with this source:

class Hello
{
public static final void main(String[] args)
{
System.out.println("Hello world");
}
}

and Makefile:

all: Hello.java
gcj --main=Hello -o Hello -g Hello.java

I am using eclipse 3.2.2 and org.eclipse.cdt.core.linux_3.1.2

thanks

Rich
Re: Content Assist for Java Native Interface [message #213196 is a reply to message #213025] Tue, 01 April 2008 17:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lulin.Song.gmail.com

Thanks for reply Rich,

I think I didn't make myself clear. My problem is when you do Ctrl-Space
in eclipse, all JNI API won't show up. For example, you have a pointer of
JNIEnv (*env), typed (*env)-> then hold down 'Ctrl-Space' keys, the JNIEnv
related functions won't show up in the pop up dialog box.

Do you have this problem?

Thanks,
Re: Content Assist for Java Native Interface [message #213226 is a reply to message #213196] Wed, 02 April 2008 04:56 Go to previous messageGo to next message
Eclipse UserFriend
Lulin wrote:
> Thanks for reply Rich,
>
> I think I didn't make myself clear. My problem is when you do Ctrl-Space
> in eclipse, all JNI API won't show up. For example, you have a pointer
> of JNIEnv (*env), typed (*env)-> then hold down 'Ctrl-Space' keys, the
> JNIEnv related functions won't show up in the pop up dialog box.
>
> Do you have this problem?
>
> Thanks,
>

Do you have the include search path set up properly for the indexer (so
that it can find jni.h)?
You can easily check this by opening the include browser for your source
file.

--
Anton Leherbauer
Wind River CDT Team, Austria
Re: Content Assist for Java Native Interface [message #213269 is a reply to message #213226] Wed, 02 April 2008 10:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lulin.Song.gmail.com

Could you give me more specific instructions to set up indexer or include
path properly?

I opened Project->Properties->indexer and don't know how to do the next.
I don't know how to open 'include browser'.

I am running eclipse version 3.3.0 ( europa ).

Thanks,

Lulin
Re: Content Assist for Java Native Interface [message #213277 is a reply to message #213269] Wed, 02 April 2008 11:11 Go to previous messageGo to next message
Eclipse UserFriend
Lulin schrieb:
> Could you give me more specific instructions to set up indexer or
> include path properly?
>
> I opened Project->Properties->indexer and don't know how to do the next.
> I don't know how to open 'include browser'.
>
> I am running eclipse version 3.3.0 ( europa ).
>
> Thanks,
>
> Lulin
>

The include search path can be configured under Project > Properties >
Paths and symbols.
You can open the Include Browser for the file in the editor using Right
Click > Show In > Include Browser.

--
Anton Leherbauer
Wind River CDT Team, Austria
Re: Content Assist for Java Native Interface [message #213285 is a reply to message #213277] Wed, 02 April 2008 12:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lulin.Song.gmail.com

Now I am able to open jni.h in indexer browser. But Ctrl-Space still won't
show the JNI API.

Any idea?

Thanks,

Lulin
Re: Content Assist for Java Native Interface [message #213303 is a reply to message #213285] Wed, 02 April 2008 15:25 Go to previous messageGo to next message
Eclipse UserFriend
Lulin schrieb:
> Now I am able to open jni.h in indexer browser. But Ctrl-Space still
> won't show the JNI API.
>
> Any idea?
>
> Thanks,
>
> Lulin
>

If you changed the include search path, you probably need to do a Index
> Rebuild on the project.

--
Anton Leherbauer
Wind River CDT Team, Austria
Re: Content Assist for Java Native Interface [message #213338 is a reply to message #213303] Thu, 03 April 2008 10:29 Go to previous message
Eclipse UserFriend
Originally posted by: Lulin.Song.gmail.com

Anton,

I find out why it's still not working. My project consists of Java, C and
Fortran code. I use ant and make together to build them. The project was
created as a Java project originally. It is converted to the C project.

When it was a Java project, it wasn't any designated source folders since
ant is used. Content Assistant only works on source folder in CDT but
works on any folders in Java perspective as long as 'build path' is set
correctly.

Thanks you very much!


:) Lulin
Previous Topic:Source Folder Properties
Next Topic:New debugger type: mspgcc gdb debugger
Goto Forum:
  


Current Time: Tue Jul 22 14:38:25 EDT 2025

Powered by FUDForum. Page generated in 0.07407 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top