Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » JNI and eclipse
JNI and eclipse [message #233243] Fri, 23 April 2004 02:55 Go to next message
Eclipse UserFriend
Originally posted by: me.knoware.nl

Hi,

How to get NI working in eclipse. What plugins do you need.

Johan
Re: JNI and eclipse [message #233302 is a reply to message #233243] Fri, 23 April 2004 05:50 Go to previous messageGo to next message
Eclipse UserFriend
It works out of the box, as long as you put the native library in the
correct subdir in your plugin directory, i.e. /os/win32/x86 for a typical
windows box (adjust to match local config :).

Exactly how Eclipse does this magic would be nice to know, since we can't
get our system to do something similar. (i.e. override
System.loadLibrary()'s path's)

/Marcus

"Johan" <me@knoware.nl> wrote in message news:c6ae94$se9$2@eclipse.org...
> Hi,
>
> How to get NI working in eclipse. What plugins do you need.
>
> Johan
>
>
Re: JNI and eclipse [message #233358 is a reply to message #233302] Fri, 23 April 2004 05:51 Go to previous messageGo to next message
Eclipse UserFriend
THere is a java.library.path env. variable:
java -Djava.library.path=...

Marcus Lindblom wrote:
> It works out of the box, as long as you put the native library in the
> correct subdir in your plugin directory, i.e. /os/win32/x86 for a typical
> windows box (adjust to match local config :).
>
> Exactly how Eclipse does this magic would be nice to know, since we can't
> get our system to do something similar. (i.e. override
> System.loadLibrary()'s path's)
>
> /Marcus
>
> "Johan" <me@knoware.nl> wrote in message news:c6ae94$se9$2@eclipse.org...
>
>>Hi,
>>
>>How to get NI working in eclipse. What plugins do you need.
>>
>>Johan
>>
>>
>
>
>
Re: JNI and eclipse [message #233459 is a reply to message #233358] Fri, 23 April 2004 12:29 Go to previous messageGo to next message
Eclipse UserFriend
Yes, but how do you change that during runtime?

Using that, the eclipse.exe must search the plugin dir and add all possible
subdirs of every plugin to the lib-path before invoking java. Is that really
what happens (seems a bit awkward)?

Our current solution is to use our own loadLibrary() call which knows where
to look, and in turn calls System's loadLibrary. However, this is
inconvenient when mixing with other java libs using native parts.

/Marcus

"Guillaume Pothier" <gpothier@free.fr> wrote in message
news:c6b6l5$rre$2@eclipse.org...
> THere is a java.library.path env. variable:
> java -Djava.library.path=...
>
> Marcus Lindblom wrote:
> > It works out of the box, as long as you put the native library in the
> > correct subdir in your plugin directory, i.e. /os/win32/x86 for a
typical
> > windows box (adjust to match local config :).
> >
> > Exactly how Eclipse does this magic would be nice to know, since we
can't
> > get our system to do something similar. (i.e. override
> > System.loadLibrary()'s path's)
> >
> > /Marcus
> >
> > "Johan" <me@knoware.nl> wrote in message
news:c6ae94$se9$2@eclipse.org...
> >
> >>Hi,
> >>
> >>How to get NI working in eclipse. What plugins do you need.
> >>
> >>Johan
> >>
> >>
> >
> >
> >
Re: JNI and eclipse [message #233475 is a reply to message #233459] Fri, 23 April 2004 12:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

Basically the way Eclipse does it is that the class calling the
System.loadLibrary() comes from a special classloader. And that
classloader overrides the findLibrary method. There is a classloader per
plugin, so each plugin knows only its own library paths (e.g. os/...
under the plugin directory) and searches there for the library.

--
Thanks, Rich Kulp

Re: JNI and eclipse (solved) [message #233567 is a reply to message #233475] Fri, 23 April 2004 14:46 Go to previous messageGo to next message
Eclipse UserFriend
Ah. Yes, that would do the trick. Thanks!

/Marcus

"Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
news:c6bgjf$9n6$1@eclipse.org...
> Basically the way Eclipse does it is that the class calling the
> System.loadLibrary() comes from a special classloader. And that
> classloader overrides the findLibrary method. There is a classloader per
> plugin, so each plugin knows only its own library paths (e.g. os/...
> under the plugin directory) and searches there for the library.
>
> --
> Thanks, Rich Kulp
> 
>
Re: JNI and eclipse [message #234205 is a reply to message #233475] Sun, 25 April 2004 16:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pkorros.bigfoot.com

I have the following problem. My class uses System.loadLibrary to load a dll
but that dll has depedencies to other dlls.
Where should i put these other dlls?
Putting them in os/win32/x86 dosn't solve my problem.

"Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
news:c6bgjf$9n6$1@eclipse.org...
> Basically the way Eclipse does it is that the class calling the
> System.loadLibrary() comes from a special classloader. And that
> classloader overrides the findLibrary method. There is a classloader per
> plugin, so each plugin knows only its own library paths (e.g. os/...
> under the plugin directory) and searches there for the library.
>
> --
> Thanks, Rich Kulp
> 
>
Re: JNI and eclipse [message #234248 is a reply to message #234205] Sun, 25 April 2004 23:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jm.nospam.steranka.com

My gut feeling is that they need to be on your "PATH".
I'm assuming your using Windows (not UNIX) because you mention
win32/x86.
The way windows works is it searches your PATH to find DLLs.
Unix has an environment variable called LD_LIBRARY_PATH.
So try this:
(1) Start a DOS shell,
(2) Add your DLL directories to your PATH,
(3) Start up Eclipse from that DOS shell, and it will inherit
your PATH settings.
(4) When Eclipse launches another application your PATH will
be set (by default) and your Launched APP should be able
to find the DLLs that are needed.

NOTE: Another alternative is to add the necessary directories
to your Windows environment variable PATH and then restart Eclipse.
This is likely easier but has the downside of those directories being
on your path for all applications (which might cause problems).

HTH,
Patrick Steranka



In article <c6h7jk$6ta$1@eclipse.org>, pkorros@bigfoot.com says...
> I have the following problem. My class uses System.loadLibrary to load a dll
> but that dll has depedencies to other dlls.
> Where should i put these other dlls?
> Putting them in os/win32/x86 dosn't solve my problem.
>
> "Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
> news:c6bgjf$9n6$1@eclipse.org...
> > Basically the way Eclipse does it is that the class calling the
> > System.loadLibrary() comes from a special classloader. And that
> > classloader overrides the findLibrary method. There is a classloader per
> > plugin, so each plugin knows only its own library paths (e.g. os/...
> > under the plugin directory) and searches there for the library.
> >
> > --
> > Thanks, Rich Kulp
Re: JNI and eclipse [message #234661 is a reply to message #234248] Mon, 26 April 2004 14:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pkorros.bigfoot.com

Yes but i can't tell all my plugin's users to do that.

"Patrick Steranka" <jm@nospam.steranka.com> wrote in message
news:MPG.1af64df59131a899989690@news.eclipse.org...
> My gut feeling is that they need to be on your "PATH".
> I'm assuming your using Windows (not UNIX) because you mention
> win32/x86.
> The way windows works is it searches your PATH to find DLLs.
> Unix has an environment variable called LD_LIBRARY_PATH.
> So try this:
> (1) Start a DOS shell,
> (2) Add your DLL directories to your PATH,
> (3) Start up Eclipse from that DOS shell, and it will inherit
> your PATH settings.
> (4) When Eclipse launches another application your PATH will
> be set (by default) and your Launched APP should be able
> to find the DLLs that are needed.
>
> NOTE: Another alternative is to add the necessary directories
> to your Windows environment variable PATH and then restart Eclipse.
> This is likely easier but has the downside of those directories being
> on your path for all applications (which might cause problems).
>
> HTH,
> Patrick Steranka
>
>
>
> In article <c6h7jk$6ta$1@eclipse.org>, pkorros@bigfoot.com says...
> > I have the following problem. My class uses System.loadLibrary to load a
dll
> > but that dll has depedencies to other dlls.
> > Where should i put these other dlls?
> > Putting them in os/win32/x86 dosn't solve my problem.
> >
> > "Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
> > news:c6bgjf$9n6$1@eclipse.org...
> > > Basically the way Eclipse does it is that the class calling the
> > > System.loadLibrary() comes from a special classloader. And that
> > > classloader overrides the findLibrary method. There is a classloader
per
> > > plugin, so each plugin knows only its own library paths (e.g. os/...
> > > under the plugin directory) and searches there for the library.
> > >
> > > --
> > > Thanks, Rich Kulp
Re: JNI and eclipse [message #235680 is a reply to message #234661] Wed, 28 April 2004 00:07 Go to previous message
Eclipse UserFriend
Originally posted by: jm.nospam.steranka.com

In article <c6jiov$pqq$1@eclipse.org>, pkorros@bigfoot.com says...
> Yes but i can't tell all my plugin's users to do that.

LOL. Well, I didn't say it was a good idea. :-)
If this is for a plug-in, then the plug-in install should
do what all good windows apps do (sigh)...
Copy the DLL to c:\winnt\system or c:\winnt\system32!

The other alternative is, of course, to update the "path"
and add the directory where your DLL is. This, however, is not
often done. :-(

Regards,
Patrick Steranka

>
> "Patrick Steranka" <jm@nospam.steranka.com> wrote in message
> news:MPG.1af64df59131a899989690@news.eclipse.org...
> > My gut feeling is that they need to be on your "PATH".
> > I'm assuming your using Windows (not UNIX) because you mention
> > win32/x86.
> > The way windows works is it searches your PATH to find DLLs.
> > Unix has an environment variable called LD_LIBRARY_PATH.
> > So try this:
> > (1) Start a DOS shell,
> > (2) Add your DLL directories to your PATH,
> > (3) Start up Eclipse from that DOS shell, and it will inherit
> > your PATH settings.
> > (4) When Eclipse launches another application your PATH will
> > be set (by default) and your Launched APP should be able
> > to find the DLLs that are needed.
> >
> > NOTE: Another alternative is to add the necessary directories
> > to your Windows environment variable PATH and then restart Eclipse.
> > This is likely easier but has the downside of those directories being
> > on your path for all applications (which might cause problems).
> >
> > HTH,
> > Patrick Steranka
> >
> >
> >
> > In article <c6h7jk$6ta$1@eclipse.org>, pkorros@bigfoot.com says...
> > > I have the following problem. My class uses System.loadLibrary to load a
> dll
> > > but that dll has depedencies to other dlls.
> > > Where should i put these other dlls?
> > > Putting them in os/win32/x86 dosn't solve my problem.
> > >
> > > "Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
> > > news:c6bgjf$9n6$1@eclipse.org...
> > > > Basically the way Eclipse does it is that the class calling the
> > > > System.loadLibrary() comes from a special classloader. And that
> > > > classloader overrides the findLibrary method. There is a classloader
> per
> > > > plugin, so each plugin knows only its own library paths (e.g. os/...
> > > > under the plugin directory) and searches there for the library.
> > > >
> > > > --
> > > > Thanks, Rich Kulp
>
>
>
Previous Topic:How do I get emacs key bindings to work in Eclipse 3.0M8?
Next Topic:build problem
Goto Forum:
  


Current Time: Mon Apr 28 01:35:43 EDT 2025

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

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

Back to the top