aspose file tools*
The moose likes Java in General and the fly likes java Unable to load the library libvlc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "java Unable to load the library libvlc" Watch "java Unable to load the library libvlc" New topic
Author

java Unable to load the library libvlc

Fernando Borsatti
Greenhorn

Joined: Dec 14, 2010
Posts: 5
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

Joined: Jul 26, 2007
Posts: 9995
    
    7

Welcome to the Ranch.

A little googling gave me this http://mailman.videolan.org/pipermail/vlc-devel/2008-April/042277.html


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13884
    
  10

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

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Fernando Borsatti
Greenhorn

Joined: Dec 14, 2010
Posts: 5
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

Joined: Aug 16, 2005
Posts: 13884
    
  10

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

Joined: Oct 13, 2005
Posts: 36598
    
  16
Too difficult a question for "beginning". Moving thread.
Fernando Borsatti
Greenhorn

Joined: Dec 14, 2010
Posts: 5
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

Joined: Dec 14, 2010
Posts: 5
somebody else?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13884
    
  10

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

Joined: Dec 14, 2010
Posts: 5
Now he give me another error, something like that: " Problematic frame c libvlcore" and kill the aplication
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13884
    
  10

That sounds like an error that is specific to libvlc - you'd better ask that on the VideoLAN forums.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java Unable to load the library libvlc
 
Similar Threads
Help in configuration of SSL in Windows 2000
Portal integration
Why does a java application takes more time to load
Using JNA in web application
JNI behaviour change on AIX (java5 -> java6)?