• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java Unable to load the library libvlc

 
Fernando Borsatti
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an aplication in java wich run videos by jvlc. The application run perfectly on ubuntu, but on windows xp or Windows 7 he give me this error:
java.lang.UnsatisfiedLinkError: Unable to load library 'libvlc'.
Somebody can help-me?
Thanks.
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15205
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

You need to make sure that Java can find the native libraries that the program you're trying to run needs. One way to do that is to add the directory that contains the DLLs to the PATH, another way is to use the -Djava.library.path=<directory name> switch on the command line when you run your Java program. For example:

java -Djava.library.path="C:\Program Files\vlc\lib" com.mypackage.MyProgram
 
Fernando Borsatti
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I put the dlls in system32 and i tried the java -Djava.library, but with no sucess. Obs: Also added in my classpath.
Thanks for yours answer
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15205
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Putting the DLLs in a directory that is in the classpath will certainly not work; the classpath is only for finding Java classes, not native libraries.

Note that it should be -Djava.library.path, not -Djava.library as you wrote.

Which DLLs do you have? The specific error message says that it is looking for a DLL named libvlc.dll.
 
Campbell Ritchie
Sheriff
Posts: 48382
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too difficult a question for "beginning". Moving thread.
 
Fernando Borsatti
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper de Jong wrote:Putting the DLLs in a directory that is in the classpath will certainly not work; the classpath is only for finding Java classes, not native libraries.

Note that it should be -Djava.library.path, not -Djava.library as you wrote.

Which DLLs do you have? The specific error message says that it is looking for a DLL named libvlc.dll.


I wrote -Djava.library[b].path in the variavel and the dll wich i put in system32 is the libvlc.dll
 
Fernando Borsatti
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
somebody else?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15205
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it still not working? That's strange. Are you absolutely sure that the DLL is in the right directory? For example, you entered:

java -Djava.library.path=C:\myproject org.mypackage.MyProgram

and you have a library called libvlc.dll in directory C:\myproject? Does that DLL try to load other DLLs that you also need to have in the PATH somewhere? Are you sure that the DLL works for your version of Windows (it might be, for example, that the DLL you have is 64-bit while you have 32-bit Windows, or 32-bit Java on 64-bit Windows).
 
Fernando Borsatti
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now he give me another error, something like that: " Problematic frame c libvlcore" and kill the aplication
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15205
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That sounds like an error that is specific to libvlc - you'd better ask that on the VideoLAN forums.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic