/** * Returns the "java" program, which is currently running. * It should be $JAVA_HOME/bin/java (or %JAVA_HOME%\bin\java.exe), where * the JAVA_HOME is the home of the JDK or JRE. * @return */ private static File getJavaExecutable() { String javaHome = System.getProperty("java.home"); File javaHomeDir = new File(javaHome); return new File(new File(javaHomeDir,"bin"),OS.programName("java")); }
public void start() throws LiveIOProgramExecutionException { if (OS.isWindows()) { // C&C's craziness on Windows... this.modelsDir = this.modelsDir.replaceAll("\\\\", "\\\\\\\\"); } System.out.println("["+this.getClass().getName()+"] models directory = " +this.modelsDir); LinkedList<String> programAndArgs = new LinkedList<String>(); programAndArgs.add(this.programName); programAndArgs.add("--models"); programAndArgs.add(this.modelsDir); execution = new LiveIOProgramExecution(programAndArgs); execution.start(); converter = new TextToPennTreeBankConverter(); }
/** * Parser initializations. * @throws LiveIOProgramExecutionException */ private void start() throws LiveIOProgramExecutionException { if (OS.isWindows()) { // C&C's craziness on Windows... this.modelsDir = this.modelsDir.replaceAll("\\\\", "\\\\\\\\"); } System.out.println("["+this.getClass().getName()+"] models directory = " +this.modelsDir); LinkedList<String> programAndArgs = new LinkedList<String>(); programAndArgs.add(this.exec); programAndArgs.add(MODELS_ARG_SPECIFIER); programAndArgs.add(this.modelsDir); //execution = new LiveIOProgramExecution(programAndArgs,Charset.forName(C_AND_C_CHARSET),true); execution = new LiveIOProgramExecution(programAndArgs,java.nio.charset.Charset.forName(C_AND_C_CHARSET),false,false,true); //execution = new LiveIOProgramExecution(programAndArgs,null,true,false,true); //execution = new LiveIOProgramExecution(programAndArgs); execution.start(); converter = new eu.excitementproject.eop.lap.biu.en.tokenizer.TextToPennTreeBankConverter(); }
tdfg.generate(); String[] commandArray = new String[]{OS.programName(GRAPH_VIZ_PROGRAM_NAME),"-T"+GRAPH_IMAGE_FORMAT,"-O",dotFile.toString()}; LinkedList<String> commandList = new LinkedList<String>(); for (String s : commandArray)
File file=null; if (bSort) { if (OS.isWindows()) throw new Exception("numeric sort of files is not supported at Windows"); file = new java.io.File(infiles[i] + ".sorted");
throw new VisualTracingToolException("Could not run the \"dot\" program.\nIs GraphViz installed on your computer?\nIs \""+ OS.programName("dot")+"\" in your PATH?\nNote that there might be other reasons, please see nested exception." , iox);