Re: [prism] "java.lang.UnsatisfiedLinkError: no prism in java.library.path" when running PRISM programmatically

403 views
Skip to first unread message

Dave Parker

unread,
Aug 9, 2015, 6:34:56 PM8/9/15
to prismmod...@googlegroups.com, random.e...@gmail.com
Hi John,

To run code that accesses PRISM programatically, you need to set up the
Java classpath and also make sure that the native libraries in the lib
directory can be found. On Windows, the latter is done by changing the
path environment variable. After copying your example file into within
the PRISM directory of an unpacked binary release, this works for me:

javac -cp lib\prism.jar Checker.java
path=lib;%path%
java -cp .;lib\prism.jar;lib\* Checker

Best wishes,

Dave.

On 08/08/2015 15:51, John Smith wrote:
> Hi,
>
> I am trying to run PRISM programmatically: my computer is running
> windows 7 64bit, I have installed both java 32bit and 64bit and I am
> using eclipse to program in. I have installed prism 4.2.1 32bit.
>
> I have added the 32bit prism and java libraries to the Java Build Path
> for my project. The exact code I so far have is:
>
> |
> importjava.io.File;
>
> importparser.ast.ModulesFile;
> importparser.ast.PropertiesFile;
> importprism.Prism;
> importprism.PrismFileLog;
> importprism.PrismLog;
>
> publicclassChecker{
>
> publicStringmodel_path ="model.pm";
> publicStringprops_path ="properties.props";
> publicPrismLoglog;
>
> publicstaticvoidmain(String[]args){
> Checkerchecker =newChecker();
> checker.verify();
> }
>
> publicvoidverify(){
> try{
> Prismprism =newPrism(log,newPrismFileLog("stdout"));
> prism.setEngine(Prism.HYBRID);
> ModulesFilemf =prism.parseModelFile(newFile(model_path));
> PropertiesFilepf
> =prism.parsePropertiesFile(mf,newFile(props_path));
> prism.loadPRISMModel(mf);
> prism.setVerbose(true);
> prism.modelCheck(pf,pf.getProperty(0));
> }catch(Exceptione){
> e.printStackTrace();
> }
> }
> }
> |
>
> But this keeps giving the error "java.lang.UnsatisfiedLinkError: no
> prism in java.library.path", when debugging this happens when Prism is
> instantiated and execution stops at this line. I saw on the PRISM
> website that this occurs if the wrong version of Java is used, but I
> have double checked the build path uses the 32bit (same as the prism
> install).
>
> I would appreciate any and all help.
>
> Many thanks.
>
> --
> You received this message because you are subscribed to the Google
> Groups "PRISM model checker" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to prismmodelchec...@googlegroups.com
> <mailto:prismmodelchec...@googlegroups.com>.
> To post to this group, send email to prismmod...@googlegroups.com
> <mailto:prismmod...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/prismmodelchecker.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages