I am working on a CDF(file mastercard uses) file parser in Java and I am using the API found here. In order to use this API you need the jar file..
I don't understand how I am getting this exception since it should be handled in the getFile() method.. I google'd around and I still don't understand what the issue is.. if anyone can point me in the right direction that would be great. By following the stacktrace.. to me it seems it's an issue with the library.
The link to the api is found here: http://cdf.gsfc.nasa.gov/cdfjava_doc/cdf34/
When trying to open a CDF file I am getting this error after running the program:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no cdfNativeLibrary in jav
a.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at gsfc.nssdc.cdf.CDFNativeLibrary.<clinit>(CDFNativeLibrary.java:47)
at gsfc.nssdc.cdf.CDF.open(CDF.java:426)
at gsfc.nssdc.cdf.CDF.open(CDF.java:385)
at FileModel.getFile(FileModel.java:21)
at FileModel.main(FileModel.java:9)
Here is my source code:
import gsfc.nssdc.cdf.*;
import gsfc.nssdc.cdf.util.*;
public class FileModel
{
public static void main(String[] args)
{
getFile();
}
public static void getFile()
{
try
{
CDF cdf = CDF.open("outbound_MidCycle_File.xml");
//System.out.println(cdf.getID());
}
catch(CDFException e)
{
System.out.println("ERROR Cannot open CDF File");
}
catch(Exception e)
{
System.out.println("ERROR");
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}
The commands I run are as follows:
javac -cp '.:cdfjava.jar' FileModel.java
java -cp '.:cdfjava.jar' FileModel