I have started a java project. I want to use a library which is called PDFnet. But It gives error. Where do I make wrong?
public class MainClass {
public static void main(String[] args)
{ //System.out.println(System.getProperty("java.library.path"));
//System.loadLibrary("C:\\Users\\BDagli\\Downloads\\PDFNetC64\\Lib\\PDFNet");
boolean uninstallPrinterWhenDone = false; // change this to test the uninstallation functions
PDFNet.initialize();
C:\Program Files\Java\jre7\bin;C:\WINDOWS\Sun\Java\bin;Files\Java\jdk1.7.0_71\bin;.....
Exception in thread "main" java.lang.UnsatisfiedLinkError: no PDFNetC in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at pdftron.PDF.PDFNet.<clinit>(PDFNet.java:21)
at com.pdf.net.MainClass.main(MainClass.java:19)
I wouldn't recommend putting any dll in the System32 folder (without a very good reason). At the very least you can end up using libraries you didn't intend to since System32 might be a higher priority folder for library loading. At the very least, use the PATH environment variable to specify the folder where PDFNetC.dll is.
However it is better to 'solve' the issue... If you look at the Java samples that come with PDFNet, you will see the following file in all the JAVA sample folders, RunText.bat which does the following.
@echo off
setlocal
set TEST_NAME=DigitalSignaturesTest
javac.exe -cp .;../../../Lib/PDFNet.jar *.java
java.exe -Djava.library.path=../../../Lib -classpath .;../../../Lib/PDFNet.jar %TEST_NAME%
endlocal
So you just need to set the java.library.path to the folder where PDFNetC.dll is in your IDE. I'm not sure how to set it in your IDE, but I'm sure it is easy to find.
Here is the fist link I found on google describing this variable better. http://www.coderanch.com/t/377174/java/java/java-library-path