我在lib文件夹中有一个带有两个可执行jar的项目。我正在项目的主类文件中执行这些jar文件。一切正常。
现在将此类导出为jar文件时,我无法获得结果。请帮助我导出此项目,包括lib文件夹中的jar。
public class outward {
public static void main(String args[]) throws IOException {
try {
File file_location = new File ("C:/transfer/test.pdf");
PDDocument doc = PDDocument.load(new File(file_location));
int pages_number = doc.getNumberOfPages();
String pdf_to_csv = "java -jar ./lib/tabula.jar " + "\"" + file_location + "\"" + " -p 2-" + pages_number + " -o ecpix.csv";
String csv_to_xlsx = "java -jar ./lib/csvtoxlsx.jar ecpix.csv ecpix.xlsx";
Process p1 = Runtime.getRuntime().exec(pdf_to_csv);
try {
p1.waitFor();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Process p2= Runtime.getRuntime().exec(csv_to_xlsx);
try {
p2.waitFor();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
catch (IOException e) {
e.printStackTrace();
}
}
}