0
개미 프로젝트 통합 :나는 다음 프로젝트를 실행하려면
이1-git clone https://gforge.inria.fr/git/melinda/melinda.git
2-cd melinda/trunk/rdfifd/
3-ant jar
4- java -jar pseudo-keys.jar -t -i /path/to/rdf_file -o /path/to/output/file
그래서 내가 어떻게 통합 할 수 있습니다과 : 프로젝트 페이지에서
https://gforge.inria.fr/plugins/mediawiki/wiki/melinda/index.php/RDF_keys
을, 그들은 다음과 같은 단계를 다시 시작 이 프로젝트를 이클립스 프로젝트에서 실행 하시겠습니까?
리눅스 명령 줄에서 이미이 setp를 따르고 있으며 제대로 작동하며 pseudo-keys.jar이 생성됩니다. 나는이 .JAR을 내 노트북에서 다음 코드 쓰기 :
java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main"
어떤 도움 코드를 실행하십시오
public class TestDriver {
/** Executes a command */
public static void execute(String cmd, File folder) throws Exception {
Process p = Runtime.getRuntime().exec(cmd, null, folder);
BufferedReader bri = new BufferedReader(new InputStreamReader(p.getInputStream()));
BufferedReader bre = new BufferedReader(new InputStreamReader(p.getErrorStream()));
String s1, s2 = null;
while (null != (s1 = bri.readLine()) || null != (s2 = bre.readLine())) {
if (s1 != null) System.out.println(s1);
if (s2 != null) System.err.println(s2);
}
p.waitFor();
}
public static void main(String[]args) throws Exception{
String cmd = "java -jar C:/Users/user/Desktop/pseudo-keys.jar -t -i C:/Users/user/Desktop/randomLocation/datasetLocation/restaurant1.rdf -o C:/Users/user/Desktop/randomLocation/key.xml";
execute(cmd, null);
}
실행은 다음과 같은 오류가 줄을? 내 실수는 어디 갔지?
는
Sir @howlger, 감사합니다. 당신의 힌트로 소프트웨어는 일식으로 돌아가고 있습니다. 그러나 제발 내 자신의 자바 프로젝트 에서이 프로젝트를 통합 할 수 있습니다 제발. 실행 설정이 아닌 코드에서 인자를 어떻게 assemble 할 수 있습니까? – bib
@bib Java 코드에서 'fr.inrialpes.exmo.rdfkeys.KeyExtraction'의 main 메소드를 호출 할 수도 있습니다. 지. KeyExtraction.main (새로운 String [] - "t", "-i", "/ path/to/rdf_file", "-o", "/ path/to/output/file"})'. – howlger
고마워요. Sir @howlger – bib