• Post Reply Bookmark Topic Watch Topic
  • New Topic

two questions  RSS feed

 
Andrew Lit
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
the first one is:
how should i deal with this error
java.lang.UnsatisfiedLinkError: no lib2 in java.library.path?
and the second is:
assume that i have something like this

my question is how/why it is possible to create an object of an Interface???
 
Greg Charles
Sheriff
Posts: 3015
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Andrew,
It's probably better to post two question as separate threads unless they're related. Be that as it may:
1) You're trying to load a shared libary that doesn't exist in your library path. You can see what that path is with:

The file would be lib2.dll on Window or something like llib2.so on Unix.
I think you can add directories by setting the LD_LIBRARY_PATH environment variable, but my memory is fuzzy on that point.
2) You cannot create objects from an interface, but you can make classes that implement an interface, then make objects from those classes. You can then use interfaces as method parameters and return values, but what you really pass around are the objects created from the classes that implement the interfaces. It's pretty cool when you get the hang of it.
 
Andrew Lit
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Greg Charles:

You can then use interfaces as method parameters and return values, but what you really pass around are the objects created from the classes that implement the interfaces.

indeed
thank you
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!