Hi,
I have solved the problem, I have add the path of ppl_java.jar to the
native_class_path of my project
and I have removed from the class_path of the run configuration. It
seems that works fine.
Thank you very much,
Laura
On 12 abr, 09:38, LauraPanizo <
panizo.ja...@gmail.com> wrote:
> Thanks Peter,
> I have used thislibraryin a normal Java program and to use it, I
> added it to the built path of the Java project and also to the
> classpath of the run configuration.
> I have used jpf-template to generate my project. Where do I have to
> include the userlibrary? Do I hace to include anything in the
> jpf.properties of my project?
>
> Thanks,
> Laura
>
> On 11 abr, 18:51, Peter Mehlitz <
pcmehl...@gmail.com> wrote:
>
> > if you use System.load(pathName) there is not much JPF configuration involved (as opposed to System.loadLibrary(fileName), which uses the JPFClassLoader and '<project>.native_libraries' settings).
>
> > You actually get the exception not for loading your native lib, but for calling initialize_library(), so you have to check if the signature is right. Look at parma_polyhedra_library.Parma_Polyhedra_Library and see if it matches the sources of libppl_java.so
>
> > -- Peter
>
> > On Apr 11, 2011, at 1:03 AM, LauraPanizo wrote:
>
> > > Dear all,
> > > I want to use a external userlibrary(libppl_java.so) in my java
> > > program.
> > > I have implemented a native peer that uses the methods of the external
> > >library, but when I execute the JPF it fails.
> > > I have executed the program without calling the methods of the user
> > >libraryto ensure that the native peers and the model class works
> > > correctly. I have also tested that thelibraryworks correctly.
> > > That is part of the code:
>
> > > /***Model class:***/
> > > package zero.example;
>
> > > public class TestClass {
> > > public native int enabled();
> > > }
>
> > > /***Peer Class***/
> > > package gov.nasa.jpf.jvm;
>
> > > public class JPF_zero_example_TestClass {
>
> > > //Esta clase sera la que llame a PPL
>
> > > public static void $init____V (MJIEnv env, int rcls) {
> > > System.out.println("native classpath works");
>
> > > }
> > > public static int enabled____I(MJIEnv env, int objRef){
> > > String ver= null;
> > > try{
> > > System.load("/usr/local/lib/ppl/libppl_java.so");
>
> > > parma_polyhedra_library.Parma_Polyhedra_Library.initialize_library();
> > > ver = parma_polyhedra_library.Parma_Polyhedra_Library.version();
> > > System.out.println("Libraryversion "+ver);
> > > }catch(Exception e){
> > > System.out.println("error");
> > > }
> > > return 1;
> > > }
>
> > > If I included the userlibraryin the classpath of run-JPF (eclipse)