Skip to main content

Problem to compile project with jdic library

1 reply [Last post]
lukasito19
Offline
Joined: 2010-03-27

I've added a jdic.jar library to my project, when I want to register a new extension, it throws an exception...

  System.out.println("1.");<br />
            AssociationService service = new AssociationService();<br />
            System.out.println("2.");<br />
            Association association = new Association();</p>
<p>            System.out.println("3.");<br />
            association.addFileExtension("flem");<br />
            System.out.println("4.");<br />
            //association.setIconFileName(Main.class.getResource("icon/Untitled.png").toString());<br />
            System.out.println("5.");<br />
            association.addAction(new Action("open", "C:\\WINDOWS\\system32\\NOTEPAD.EXE"));<br />
            System.out.println("6.");<br />
            try {<br />
                System.out.println("7.");<br />
                service.registerUserAssociation(association);<br />
                System.out.println("8.");<br />
            } catch (AssociationAlreadyRegisteredException ex) {<br />
                System.out.println("9.");<br />
                System.err.println("Asociation already registred!");<br />
                System.out.println("10.");<br />
            } catch (RegisterFailedException ex) {<br />
                System.out.println("11.");<br />
                System.err.println("Register failed!");<br />
                System.out.println("12.");<br />
            }

and the output is:

1.<br />
2.<br />
3.<br />
4.<br />
5.<br />
6.<br />
7.<br />
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jdic in java.library.path<br />
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)<br />
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)<br />
        at java.lang.System.loadLibrary(System.java:1028)<br />
        at org.jdesktop.jdic.filetypes.internal.WinRegistryWrapper.(Unknown Source)<br />
        at org.jdesktop.jdic.filetypes.internal.WinRegistryUtil.isSubKeyExist(Unknown Source)<br />
        at org.jdesktop.jdic.filetypes.internal.WinRegistryUtil.isFileExtExist(Unknown Source)<br />
        at org.jdesktop.jdic.filetypes.internal.WinAppAssociationWriter.isAssociationExist(Unknown Source)<br />
        at org.jdesktop.jdic.filetypes.AssociationService.registerUserAssociation(Unknown Source)<br />
        at javaapplication2.Main.main(Main.java:36)<br />
Java Result: 1

when I change the 0.9.1 ver. for 0.9.5 ver. the output is:

<br />
1.<br />
java.lang.ClassNotFoundException: org.jdesktop.jdic.filetypes.internal.AppAssociationReaderFactory_windows<br />
2.<br />
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)<br />
3.<br />
4.<br />
5.<br />
        at java.security.AccessController.doPrivileged(Native Method)<br />
6.<br />
7.<br />
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)<br />
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)<br />
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)<br />
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)<br />
        at org.jdesktop.jdic.filetypes.AssociationService.(Unknown Source)<br />
        at javaapplication2.Main.main(Main.java:23)<br />
Exception in thread "main" java.lang.NullPointerException<br />
        at org.jdesktop.jdic.filetypes.AssociationService.registerUserAssociation(Unknown Source)<br />
        at javaapplication2.Main.main(Main.java:36)<br />
Java Result: 1

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
lukasito19
Offline
Joined: 2010-03-27

I cant believe that nobody knows what I'm talkin about...Please someone help me.