私はこれを理解できないようですか?dec.exeをparamで実行したくない
ここに私のファイル構造:
ここで、マウスクリックで使用しているコードを示します。
Process process = null;
try {
process = new ProcessBuilder("dec.exe",idir,odir).start();
} catch (IOException e2) { e2.printStackTrace(); }
InputStream is = process.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
String total = "";
try {
while ((line = br.readLine()) != null) {
total += line;
txtrAsdasda.setText(total);
}
}
} catch (IOException e1) { e1.printStackTrace(); }
次のエラーが発生します。
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.lang.ProcessBuilder.start(Unknown Source)
at pw.ConverterUIApp$3.actionPerformed(ConverterUIApp.java:128)
...
と
java.io.IOException: Cannot run program "dec.exe": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)