1

I have already seen the links

  1. Link 1

  2. Link 2

  3. Link 3

These are my system specs

  1. Windows 64bit

  2. Java 11 64 bit

  3. Vlc 32 bit

  4. vlcj 3.5.0 downloaded with maven

This is my code

NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(),"C:Program Files (x86)\\VideoLAN\\VLC");
Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(),LibVlc.class);

And This Is My Error

java.lang.UnsatisfiedLinkError: Unable to load library 'libvlc': JNA native support (win32-amd64/libvlc.dll) not found in resource path (C:\Program Files\Java\Vlcj\jna-3.5.2.jar;C:\Program Files\Java\Vlcj\platform-3.5.2.jar;C:\Users\Home\Documents\NetBeansProjects\JDK Examples\Chat Application\Tests\build\classes)

Now i know you shoudn't be loading VLC 32 bit libraries using an 64 bit JRE and that's why i don't expect this program to work(or maybe it will i don't know) but the error message would have been diffrent something starting like IA32 or similar but that's not the case , as you can see despite adding the search path using NativeLibrary class the Native class seems to be searching for the dll's in the jar files & in my project path but not in the search path i have explictly mentioned so my Native can't even locate the dll files.

Help anyone?

Sync it
  • 1,180
  • 2
  • 11
  • 29
  • How is your problem [different from this one](https://github.com/caprica/vlcj/issues/359)? – Daniel Widdis Jul 25 '20 at 16:29
  • I tired with both 64 & 32 bit vlc but same error. Reinstalling both didn't fix the problem – Sync it Jul 25 '20 at 16:33
  • Does your file path need to start `C:\\Program...` – Daniel Widdis Jul 25 '20 at 16:36
  • And silly question but when you installed 64 bit did you remove the `(x86)` from the path? – Daniel Widdis Jul 25 '20 at 16:38
  • Yes it does start with C://Program Files and yes i manually uninstalled 32 bit vlc with control panel and i also deleted Preferences & Caches before installing 64 bit vlc and vice versa with 32 vlc and then i gave up and installed both but no use – Sync it Jul 25 '20 at 16:45
  • My path dosen't have to start with C:\\Program Files It can also just be C:/Program Files but both don't work removing (x86) didn't make a difference – Sync it Jul 25 '20 at 16:46
  • Class `RuntimeUtil` is part of VLCJ library. Can you call a method of this class before you have loaded the library? – Abra Jul 25 '20 at 16:50
  • Yes I can it returns libvlc when I call getLibVlcLibraryName() – Sync it Jul 25 '20 at 16:52
  • Error message looks identical to the issue I posted though, which still makes me think it's not a JNA problem, but some sort of system config/search path issue. – Daniel Widdis Jul 25 '20 at 17:00
  • Well i also added VLC_PLUGIN_PATH as an system variable but it didn't help – Sync it Jul 25 '20 at 17:15
  • This is not a valid path is it: "C:Program Files (x86)\\VideoLAN\\VLC", you are missing a backslash after the C:. And to answer another point, it will definitely not work if you mix 32bit and 64bit VLC and JVM. – caprica Jul 26 '20 at 06:24
  • Sorry it was a typo error i entered C:/Program Files(x86)/VideoLAN/VLC but it didn't work anyway i posted my fix in the answer below – Sync it Jul 26 '20 at 06:25
  • I can't see in the code why "it didn't work". Were there more suppressed exceptions than the one listed, which indicated the other paths that it searched? – Daniel Widdis Jul 26 '20 at 15:31

1 Answers1

0

I solved my problem in 3 steps

1)Using Native discovery which was suggested from the link in the first comment because NativeLibrary.addSearchPath didn't do anything so i removed that line and replaced it with

new NativeDiscovery().discover();

2)Using vlc 64 bit

2)The "Main fix" was downgrading my JDK from 11 to 1.8 for some reason vlcj 3.5 and above won't work with my latest JDK and i can't understand it but it was this main change that allowed NativeDiscovery to work

Sync it
  • 1,180
  • 2
  • 11
  • 29
  • I use vlcj with JDK 11 routinely just fine, so I very much doubt that's the real cause of your issue. IME this issue is a mismatch between JVM and VLC architectures (64-bit vs 32-bit). – caprica Jul 26 '20 at 06:27
  • I myself don't understand it but anything higher than JDK 11 wont work in my system so if you do have an explanation please do tell – Sync it Jul 26 '20 at 07:33