简体   繁体   中英

Loading an executable .jar file in Windows 10 Powershell

I am trying to execute some published java code that converts an SBML (Systems Biology Markup Language) file to three text files. Running libSBML code requires linking to a jar file "libsbmlj.jar". The code works in Eclipse, but I would like to run the code in Powershell for ease of running my biological simulation (all other commands in the workflow work in Powershell). When I try and run the code in Powershell using the following commands:

javac ToyGenInput.java
java ToyGenInput

as specified in the code instructions I get the following error:

Error: unable to load the file libsbmlj.jar.  It is likely
your LD_LIBRARY_PATH environment variable or CLASSPATH variable
does not include the directory containing the libsbmlj.jar file.

I have tried adding a separate environment variable "CLASSPATH" (I believe LD_LIBRARY_PATH is for Unix-based systems) and adding the folder path to the existing "PATH" variable, however I still get the same error. Copying the .jar file to the current directory also did not work. Does anyone have any suggestions on how to fix this?

Thank you for your time!

NB: Link to the published code: http://www.comp.nus.edu.sg/~rpsysbio/pada

The file "ToyGenInput.java" consists of the following code, calling a secondary file "SBML2SPA.java":

public class ToyGenInput{
    public static void main(String[] args){
    SBML2SPA ss=new SBML2SPA("./models/toy/toy.xml"); 
    ss.printODEs("./models/toy/");
    ss.printPar("./models/toy/");
    ss.printVar("./models/toy/");
    }
}

我相信您不应该添加文件路径,而是添加包含 jar 的文件夹的路径。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM