After one loop the program throws an exception at the new component line and quits. How do I loop until the user selects a file that works?
while(!next){
NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), folderChooser());
try{
EmbeddedMediaPlayerComponent a = new EmbeddedMediaPlayerComponent();
a.release();
next = true;
}
catch(Exception e){
next = false;
}
}
Error:
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class uk.co.caprica.vlcj.binding.LibVlc
at uk.co.caprica.vlcj.binding.LibVlcFactory.create(LibVlcFactory.java:158)
at uk.co.caprica.vlcj.player.MediaPlayerFactory.<init>(MediaPlayerFactory.java:236)
at uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent.onGetMediaPlayerFactory(EmbeddedMediaPlayerComponent.java:278)
at uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent.<init>(EmbeddedMediaPlayerComponent.java:168)
at sv1.MainRun.try1(MainRun.java:107)
at sv1.MainRun.<init>(MainRun.java:82)
at sv1.Start.main(Start.java:7)