我正在尝试从 Windows 命令提示符运行 Java 命令行程序,以从 BioPortal (http://bioportal.bioontology.org) 提取和生成本体文件。它似乎找不到类,但也许我的 CLASSPATH 参数语法不正确。设置参考(NCBO 用户指南和 NCBO 提取工具 zip 文件)可以在我的问题底部找到。这些说明基于 Linux 语法,但我在 Windows 中运行它。
Linux 命令(来自用户指南):
java -classpath endorsed_lib/*:genlib/i2b2Common-core.jar:lib/commons/*:lib/log4j/*:lib/jdbc/*:lib/spring/*:* edu.harvard.i2b2.ncbo.extraction.NCBOOntologyExtractAll -ont {5 digit ontology id} -apikey {API key from http://bioportal.bioontology.org/account} -outputFileName {output file path}
Linux -classpath 参数包括:
endorsed_lib/*
genlib/i2b2Common-core.jar or genlib/* (only 1 jar file)
lib/commons/*
lib/log4j/*
lib/jdbc/*
lib/spring/*
*
Windows 命令(不起作用):
java -cp ".\endorsed_lib;.\genlib;.\lib\commons;.\lib\jdbc;.\lib\log4j;.\lib\spring;." edu.harvard.i2b2.ncbo.extraction.NCBOOntologyExtractAll -ont 47178 -apikey 68775b88-c12f-472c-9192-71f9b282309c -outputFileName 47178_stagingFile.txt
来自 Windows 命令提示符的错误:
Error: Could not find or load main class edu.harvard.i2b2.ncbo.extraction.NCBOOntologyExtractAll
Windows -cp (CLASSPATH) 参数包括以下路径:
\NCBOExtractionTools_1.1\Release_1_1\endorsed_lib\;
\NCBOExtractionTools_1.1\Release_1_1\genlib\;
\NCBOExtractionTools_1.1\Release_1_1\lib\commons\;
\NCBOExtractionTools_1.1\Release_1_1\lib\jdbc\;
\NCBOExtractionTools_1.1\Release_1_1\lib\log4j\;
\NCBOExtractionTools_1.1\Release_1_1\lib\spring\;
\NCBOExtractionTools_1.1\Release_1_1\;
==================
指导:
说明从第 8 页(共 16 页)开始。我在第 9 页。
在用户指南中,它引用了一个 NCBO 实用程序。可以在这里下载:
https://www.i2b2.org/software/download.html?d=310
单击标有“文件下载”的蓝色超链接或单击下面的链接(截至 2013 年 1 月 4 日的链接)> 然后单击“我接受”> 将文件 (NCBOExtractionTools_1.1.zip) 保存到本地计算机 > 提取 zip 文件
这是从 i2b2 NCBO 实用程序中提取的文件列表,因此您可以查看我们可用的 jar 文件:
\NCBOExtractionTools_1.1\Release_1_1\endorsed_lib
\NCBOExtractionTools_1.1\Release_1_1\ExtractionApplicationContext.xml
\NCBOExtractionTools_1.1\Release_1_1\FileList.txt
\NCBOExtractionTools_1.1\Release_1_1\genlib
\NCBOExtractionTools_1.1\Release_1_1\hierarchy.log
\NCBOExtractionTools_1.1\Release_1_1\i2b2_license_2.1-1159.txt
\NCBOExtractionTools_1.1\Release_1_1\lib
\NCBOExtractionTools_1.1\Release_1_1\log4j.properties
\NCBOExtractionTools_1.1\Release_1_1\NCBOExtraction_1.1.jar
\NCBOExtractionTools_1.1\Release_1_1\STAGING_FILES
\NCBOExtractionTools_1.1\Release_1_1\endorsed_lib\jaxb-api.jar
\NCBOExtractionTools_1.1\Release_1_1\endorsed_lib\jaxb-LICENSE.txt
\NCBOExtractionTools_1.1\Release_1_1\endorsed_lib\stax-api-1.0.1.jar
\NCBOExtractionTools_1.1\Release_1_1\endorsed_lib\stax-api-LICENSE.txt
\NCBOExtractionTools_1.1\Release_1_1\endorsed_lib\wstx-asl-3.0.1.jar
\NCBOExtractionTools_1.1\Release_1_1\endorsed_lib\wstx-LICENSE.txt
\NCBOExtractionTools_1.1\Release_1_1\genlib\i2b2Common-core.jar
\NCBOExtractionTools_1.1\Release_1_1\lib\commons
\NCBOExtractionTools_1.1\Release_1_1\lib\jdbc
\NCBOExtractionTools_1.1\Release_1_1\lib\log4j
\NCBOExtractionTools_1.1\Release_1_1\lib\spring
\NCBOExtractionTools_1.1\Release_1_1\lib\commons\apache-2.0license.txt
\NCBOExtractionTools_1.1\Release_1_1\lib\commons\commons-codec-1.3.jar
\NCBOExtractionTools_1.1\Release_1_1\lib\commons\commons-collections-2.1.1.jar
\NCBOExtractionTools_1.1\Release_1_1\lib\commons\commons-dbcp-1.2.2.jar
\NCBOExtractionTools_1.1\Release_1_1\lib\commons\commons-exec-1.0.jar
\NCBOExtractionTools_1.1\Release_1_1\lib\commons\commons-httpclient-3.0.jar
\NCBOExtractionTools_1.1\Release_1_1\lib\commons\commons-logging-1.0.4.jar
\NCBOExtractionTools_1.1\Release_1_1\lib\commons\commons-pool-1.3.jar
\NCBOExtractionTools_1.1\Release_1_1\lib\jdbc\ojdbc14.jar
\NCBOExtractionTools_1.1\Release_1_1\lib\jdbc\sqlserver2005
\NCBOExtractionTools_1.1\Release_1_1\lib\jdbc\sqlserver_jTDS
\NCBOExtractionTools_1.1\Release_1_1\lib\jdbc\sqlserver2005\sqljdbc.jar
\NCBOExtractionTools_1.1\Release_1_1\lib\jdbc\sqlserver2005\sqlserver_licence.rtf
\NCBOExtractionTools_1.1\Release_1_1\lib\jdbc\sqlserver_jTDS\jtds-1.2.2.jar
\NCBOExtractionTools_1.1\Release_1_1\lib\jdbc\sqlserver_jTDS\LICENSE
\NCBOExtractionTools_1.1\Release_1_1\lib\log4j\log4j-1.2.8.jar
\NCBOExtractionTools_1.1\Release_1_1\lib\log4j\log4j-LICENSE.txt
\NCBOExtractionTools_1.1\Release_1_1\lib\spring\apachelicence-2.0.txt
\NCBOExtractionTools_1.1\Release_1_1\lib\spring\spring-2.0.jar